diff --git a/ChangeLog b/ChangeLog index fd1d31348d..7fed81edc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Dec 13 12:38:16 2008 Yuki Sonoda (Yugui) + + * 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 * lib/minitest/*.rb: Imported minitest 1.3.2 r4503. diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb index 77176240c5..7807e2e3eb 100644 --- a/lib/minitest/unit.rb +++ b/lib/minitest/unit.rb @@ -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