diff --git a/spec/ruby/language/block_spec.rb b/spec/ruby/language/block_spec.rb index c0139c5da8..8425b91551 100644 --- a/spec/ruby/language/block_spec.rb +++ b/spec/ruby/language/block_spec.rb @@ -507,17 +507,21 @@ describe "arguments with _" do - it "extracts arguments with _" do - @y.m([[1, 2, 3], 4]) { |(_, a, _), _| a }.should == 2 - end - ruby_version_is ""..."1.9" do + it "extracts arguments with _" do + @y.m([[1, 2, 3], 4]) { |(_, a, _), _| a }.should == 4 + end + it "assigns the last variable named" do @y.m(1, 2) { |_, _| _ }.should == 2 end end ruby_version_is "1.9" do + it "extracts arguments with _" do + @y.m([[1, 2, 3], 4]) { |(_, a, _), _| a }.should == 2 + end + it "assigns the first variable named" do @y.m(1, 2) { |_, _| _ }.should == 1 end