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 --- test/ruby/test_exception.rb | 6 +++--- test/ruby/test_integer.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 31e5aa9f6b..4365150a13 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1542,13 +1542,13 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| def a.to_a = 1 def a.to_hash = 1 def a.to_proc = 1 - assert_raise_with_message(TypeError, "can't convert TestException::Ex to Array (TestException::Ex#to_a gives Integer)") do + assert_raise_with_message(TypeError, "can't convert TestException::Ex into Array (TestException::Ex#to_a gives Integer)") do x(*a) end - assert_raise_with_message(TypeError, "can't convert TestException::Ex to Hash (TestException::Ex#to_hash gives Integer)") do + assert_raise_with_message(TypeError, "can't convert TestException::Ex into Hash (TestException::Ex#to_hash gives Integer)") do x(**a) end - assert_raise_with_message(TypeError, "can't convert TestException::Ex to Proc (TestException::Ex#to_proc gives Integer)") do + assert_raise_with_message(TypeError, "can't convert TestException::Ex into Proc (TestException::Ex#to_proc gives Integer)") do x(&a) end end diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index f9bf4fa20c..c3d9d311c8 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -751,7 +751,7 @@ class TestInteger < Test::Unit::TestCase o = Object.new def o.to_int; Object.new; end - assert_raise_with_message(TypeError, /can't convert Object to Integer/) {Integer.try_convert(o)} + assert_raise_with_message(TypeError, /can't convert Object into Integer/) {Integer.try_convert(o)} end def test_ceildiv -- cgit v1.2.3