From 51784e51e128c55e3699927b7a2014d8950d7164 Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Thu, 23 Aug 2012 13:02:56 +0200 Subject: [PATCH] Duplicate the spec for diferent ruby versions This spec returns 4 on MRI 1.8.7p358 and 2 on MRI 1.9.3p194. --- spec/ruby/language/block_spec.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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