Fix some ruby 1.9.2 issues.
This commit is contained in:
parent
a1cae426f1
commit
35fefe1865
3 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ Sorts strings and arrays lexically.
|
||||||
if value.is_a?(Array) then
|
if value.is_a?(Array) then
|
||||||
value.sort
|
value.sort
|
||||||
elsif value.is_a?(String) then
|
elsif value.is_a?(String) then
|
||||||
value.split("").sort.to_s
|
value.split("").sort.join("")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,7 +38,7 @@ Would return ['a','c','d'].
|
||||||
raise(Puppet::ParseError, 'values_at(): Requires array to work with')
|
raise(Puppet::ParseError, 'values_at(): Requires array to work with')
|
||||||
end
|
end
|
||||||
|
|
||||||
indices = *arguments # Get them all ... Pokemon ...
|
indices = [arguments.shift].flatten() # Get them all ... Pokemon ...
|
||||||
|
|
||||||
if not indices or indices.empty?
|
if not indices or indices.empty?
|
||||||
raise(Puppet::ParseError, 'values_at(): You must provide ' +
|
raise(Puppet::ParseError, 'values_at(): You must provide ' +
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe "the shuffle function" do
|
||||||
|
|
||||||
it "should shuffle a string but the sorted contents should still be the same" do
|
it "should shuffle a string but the sorted contents should still be the same" do
|
||||||
result = @scope.function_shuffle(["adfs"])
|
result = @scope.function_shuffle(["adfs"])
|
||||||
result.split("").sort.to_s.should(eq("adfs"))
|
result.split("").sort.join("").should(eq("adfs"))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue