From d066b9e01ccb2260fac8b2580c10e73335c7c7db Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 5 Feb 2026 20:38:00 +0100 Subject: Refactor type error to be more consistent [Bug #21864] Co-Authored-By: Benoit Daloze --- spec/ruby/core/basicobject/instance_eval_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/ruby/core/basicobject/instance_eval_spec.rb') diff --git a/spec/ruby/core/basicobject/instance_eval_spec.rb b/spec/ruby/core/basicobject/instance_eval_spec.rb index f8d9d75059..475910e56e 100644 --- a/spec/ruby/core/basicobject/instance_eval_spec.rb +++ b/spec/ruby/core/basicobject/instance_eval_spec.rb @@ -284,7 +284,7 @@ describe "BasicObject#instance_eval" do def source_code.to_str() :symbol end a = BasicObject.new - -> { a.instance_eval(source_code) }.should raise_error(TypeError, /can't convert Object to String/) + -> { a.instance_eval(source_code) }.should raise_consistent_error(TypeError, /can't convert Object into String/) end it "converts filename argument with #to_str method" do @@ -303,7 +303,7 @@ describe "BasicObject#instance_eval" do filename = Object.new def filename.to_str() :symbol end - -> { Object.new.instance_eval("raise", filename) }.should raise_error(TypeError, /can't convert Object to String/) + -> { Object.new.instance_eval("raise", filename) }.should raise_consistent_error(TypeError, /can't convert Object into String/) end it "converts lineno argument with #to_int method" do @@ -322,6 +322,6 @@ describe "BasicObject#instance_eval" do lineno = Object.new def lineno.to_int() :symbol end - -> { Object.new.instance_eval("raise", "file.rb", lineno) }.should raise_error(TypeError, /can't convert Object to Integer/) + -> { Object.new.instance_eval("raise", "file.rb", lineno) }.should raise_consistent_error(TypeError, /can't convert Object into Integer/) end end -- cgit v1.2.3