Permalink
Browse files

Add more splat + Hash specs

  • Loading branch information...
1 parent 973dffa commit 5a7a3d175d1d59255f703bdb27a9b4c8b4d5d623 @jfirebaugh jfirebaugh committed Apr 16, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 spec/ruby/language/versions/send_1.9.rb
@@ -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

0 comments on commit 5a7a3d1

Please sign in to comment.