Skip to content

Commit

Permalink
Add more splat + Hash specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Apr 16, 2012
1 parent 973dffa commit 5a7a3d1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions spec/ruby/language/versions/send_1.9.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,34 @@
specs.fooM4(0,*a,3).should == [0,1,2,3]
end

it "accepts final explicit Hash arguments after the splat" do
it "accepts final Hash arguments after the splat" do
a = [1, 2]
b = { :a => 1 }
specs.fooM0RQ1(*a, b).should == [[1, 2], { :a => 1 }]
end

it "accepts final explicit literal Hash arguments after the splat" do
a = [1, 2]
specs.fooM0RQ1(*a, { :a => 1 }).should == [[1, 2], { :a => 1 }]
end

it "accepts final implicit Hash arguments after the splat" do
it "accepts final implicit literal Hash arguments after the splat" do
a = [1, 2]
specs.fooM0RQ1(*a, :a => 1).should == [[1, 2], { :a => 1 }]
end

it "accepts mandatory and explicit Hash arguments after the splat" do
it "accepts mandatory and Hash arguments after the splat" do
a = [1, 2]
b = { :a => 1 }
specs.fooM0RQ2(*a, 3, b).should == [[1, 2], 3, { :a => 1 }]
end

it "accepts mandatory and explicit literal Hash arguments after the splat" do
a = [1, 2]
specs.fooM0RQ2(*a, 3, { :a => 1 }).should == [[1, 2], 3, { :a => 1 }]
end

it "accepts mandatory and implicit Hash arguments after the splat" do
it "accepts mandatory and implicit literal Hash arguments after the splat" do
a = [1, 2]
specs.fooM0RQ2(*a, 3, :a => 1).should == [[1, 2], 3, { :a => 1 }]
end
Expand Down

0 comments on commit 5a7a3d1

Please sign in to comment.