summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2024-02-15 14:23:01 +0900
committerYusuke Endoh <mame@ruby-lang.org>2024-02-15 19:11:58 +0900
commit9d1b000bd1bb747bcc49e2d7677fb7c2b31c5a94 (patch)
treece3568e37e47e6106567c6ac7e0a981bc59627a9 /tool/lib
parent61819c87b29f3267d6a2499d9018f09cd5bcf2c4 (diff)
Show the method owner in backtraces
``` test.rb:1:in 'Object#toplevel_meth': unhandled exception from test.rb:4:in 'Foo.class_meth' from test.rb:6:in 'Foo#instance_meth' from test.rb:11:in 'singleton_meth' from test.rb:13:in '<main>' ``` [Feature #19117]
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 64332a8f53..fc51e7e97c 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1729,7 +1729,7 @@ module Test
return '<empty>' unless e.backtrace # SystemStackError can return nil.
e.backtrace.reverse_each do |s|
- break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
+ break if s =~ /in .(?:Test::Unit::(?:Core)?Assertions#)?(assert|refute|flunk|pass|fail|raise|must|wont)/
last_before_assertion = s
end
last_before_assertion.sub(/:in .*$/, '')