Skip to content

Commit

Permalink
Duplicate the spec for diferent ruby versions
Browse files Browse the repository at this point in the history
This spec returns 4 on MRI 1.8.7p358 and 2 on MRI 1.9.3p194.
  • Loading branch information
IPGlider committed Aug 23, 2012
1 parent 9b49b56 commit 51784e5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spec/ruby/language/block_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 51784e5

Please sign in to comment.