mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/minitest/test.rb (MinTest::Unit#location):
skips user-defined assertions as MiniTest's. e.g. for test/ruby/test_m17n.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ac6024f522
commit
3b1a65add3
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Dec 13 12:38:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* lib/minitest/test.rb (MinTest::Unit#location):
|
||||
skips user-defined assertions as MiniTest's.
|
||||
e.g. for test/ruby/test_m17n.rb.
|
||||
|
||||
Sat Dec 13 09:17:33 2008 Ryan Davis <ryand-ruby@zenspider.com>
|
||||
|
||||
* lib/minitest/*.rb: Imported minitest 1.3.2 r4503.
|
||||
|
|
|
@ -336,8 +336,12 @@ p $!
|
|||
end
|
||||
|
||||
def location e
|
||||
e.backtrace.find { |s|
|
||||
s !~ /in .(assert|refute|flunk|pass|fail|raise)/
|
||||
e.backtrace.reverse.inject(""){ |last, s|
|
||||
if s =~ /in .(assert|refute|flunk$|pass$|fail$|raise$)/
|
||||
break last
|
||||
else
|
||||
s
|
||||
end
|
||||
}.sub(/:in .*$/, '')
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue