From c0e2f9278ee2649d98e6750a5e6bfc5d36b4db20 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 1 Jul 2015 08:17:37 +0000 Subject: [PATCH] test_object.rb: use assert_separately * test/ruby/test_object.rb (test_redef_method_missing): use assert_separately to catch segfaults and show the diagnostic reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_object.rb | 8 +++----- 1 file 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