Update some tests for the new message format of NoMethodError

This commit is contained in:
Yusuke Endoh 2023-01-24 17:44:00 +09:00
Родитель 1fd181b453
Коммит 8f868a1a65
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -3281,7 +3281,7 @@ class TestModule < Test::Unit::TestCase
methods = singleton_class.private_instance_methods(false)
assert_include(methods, :#{method}, ":#{method} should be private")
assert_raise_with_message(NoMethodError, "private method `#{method}' called for main:Object") {
assert_raise_with_message(NoMethodError, /^private method `#{method}' called for /) {
recv = self
recv.#{method}
}

Просмотреть файл

@ -85,7 +85,7 @@ class TestNoMethodError < Test::Unit::TestCase
bug3237 = '[ruby-core:29948]'
str = "\u2600"
id = :"\u2604"
msg = "undefined method `#{id}' for \"#{str}\":String"
msg = "undefined method `#{id}' for an instance of String"
assert_raise_with_message(NoMethodError, Regexp.compile(Regexp.quote(msg)), bug3237) do
str.__send__(id)
end