From ec2f8c657116a28862b0be3d7610d3c8d271f379 Mon Sep 17 00:00:00 2001 From: Herwin Date: Tue, 6 Jan 2026 11:51:49 +0100 Subject: [PATCH] Remove some references to/compatibility issues for Ruby 3.2 --- command_line/dash_r_spec.rb | 5 +---- core/unboundmethod/equal_value_spec.rb | 3 --- shared/kernel/at_exit.rb | 5 +---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/command_line/dash_r_spec.rb b/command_line/dash_r_spec.rb index 9f673c53dc..62b8dc0014 100644 --- a/command_line/dash_r_spec.rb +++ b/command_line/dash_r_spec.rb @@ -16,10 +16,7 @@ out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1", exit_status: 1) $?.should_not.success? out.should include("REQUIRED") - - # it's tempting not to rely on error message and rely only on exception class name, - # but CRuby before 3.2 doesn't print class name for syntax error - out.should include_any_of("syntax error", "SyntaxError") + out.should include("SyntaxError") end it "does not require the file if the main script file does not exist" do diff --git a/core/unboundmethod/equal_value_spec.rb b/core/unboundmethod/equal_value_spec.rb index b2d78c50af..c9f7ad45da 100644 --- a/core/unboundmethod/equal_value_spec.rb +++ b/core/unboundmethod/equal_value_spec.rb @@ -110,9 +110,6 @@ class << self c.method(:n).should == Class.instance_method(:new).bind(c) end - # On CRuby < 3.2, the 2 specs below pass due to method/instance_method skipping zsuper methods. - # We are interested in the general pattern working, i.e. the combination of method/instance_method - # and #== exposes the wanted behavior. it "considers methods through visibility change equal" do c = Class.new do class << self diff --git a/shared/kernel/at_exit.rb b/shared/kernel/at_exit.rb index 29db79bb39..d57ab73920 100644 --- a/shared/kernel/at_exit.rb +++ b/shared/kernel/at_exit.rb @@ -60,10 +60,7 @@ result = ruby_exe('{', options: "-r#{script}", args: "2>&1", exit_status: 1) $?.should_not.success? result.should.include?("handler ran\n") - - # it's tempting not to rely on error message and rely only on exception class name, - # but CRuby before 3.2 doesn't print class name for syntax error - result.should include_any_of("syntax error", "SyntaxError") + result.should include("SyntaxError") end it "calls the nested handler right after the outer one if a handler is nested into another handler" do