diff options
-rw-r--r-- | test/ruby/test_object.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index ad836fca8f..fac5302dab 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -807,18 +807,16 @@ class TestObject < Test::Unit::TestCase def test_redef_method_missing bug5473 = '[ruby-core:40287]' ['ArgumentError.new("bug5473")', 'ArgumentError, "bug5473"', '"bug5473"'].each do |code| - out, err, status = EnvUtil.invoke_ruby([], <<-SRC, true, true) + exc = code[/\A[A-Z]\w+/] || 'RuntimeError' + assert_separately([], <<-SRC) class ::Object def method_missing(m, *a, &b) raise #{code} end end - p((1.foo rescue $!)) + assert_raise_with_message(#{exc}, "bug5473") {1.foo} SRC - assert_send([status, :success?], bug5473) - assert_equal("", err, bug5473) - assert_equal((eval("raise #{code}") rescue $!.inspect), out.chomp, bug5473) end end |