diff options
-rw-r--r-- | test/ruby/test_module.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_nomethod_error.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 6c4defd6b1..434e720f8b 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -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} } diff --git a/test/ruby/test_nomethod_error.rb b/test/ruby/test_nomethod_error.rb index 321b7ccab2..0306535943 100644 --- a/test/ruby/test_nomethod_error.rb +++ b/test/ruby/test_nomethod_error.rb @@ -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 |