mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
5f745b8313
commit
c0e2f9278e
1 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue