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/string/try_convert_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/ruby/core/string') diff --git a/spec/ruby/core/string/try_convert_spec.rb b/spec/ruby/core/string/try_convert_spec.rb index 72ce5dd8b2..7019f1fc2a 100644 --- a/spec/ruby/core/string/try_convert_spec.rb +++ b/spec/ruby/core/string/try_convert_spec.rb @@ -39,7 +39,7 @@ describe "String.try_convert" do it "sends #to_str to the argument and raises TypeError if it's not a kind of String" do obj = mock("to_str") obj.should_receive(:to_str).and_return(Object.new) - -> { String.try_convert obj }.should raise_error(TypeError, "can't convert MockObject to String (MockObject#to_str gives Object)") + -> { String.try_convert obj }.should raise_consistent_error(TypeError, "can't convert MockObject into String (MockObject#to_str gives Object)") end it "does not rescue exceptions raised by #to_str" do -- cgit v1.2.3