diff options
Diffstat (limited to 'spec/ruby/language/numbered_parameters_spec.rb')
-rw-r--r-- | spec/ruby/language/numbered_parameters_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/ruby/language/numbered_parameters_spec.rb b/spec/ruby/language/numbered_parameters_spec.rb index 06f9948c58..a3153d3cc6 100644 --- a/spec/ruby/language/numbered_parameters_spec.rb +++ b/spec/ruby/language/numbered_parameters_spec.rb @@ -90,9 +90,18 @@ describe "Numbered parameters" do proc { _2 }.parameters.should == [[:opt, :_1], [:opt, :_2]] end - it "affects binding local variables" do - -> { _1; binding.local_variables }.call("a").should == [:_1] - -> { _2; binding.local_variables }.call("a", "b").should == [:_1, :_2] + ruby_version_is "".."3.4" do + it "affects binding local variables" do + -> { _1; binding.local_variables }.call("a").should == [:_1] + -> { _2; binding.local_variables }.call("a", "b").should == [:_1, :_2] + end + end + + ruby_version_is "3.5" do + it "does not affect binding local variables" do + -> { _1; binding.local_variables }.call("a").should == [] + -> { _2; binding.local_variables }.call("a", "b").should == [] + end end it "does not work in methods" do |