diff --git a/mrblib/mtest_unit.rb b/mrblib/mtest_unit.rb index 5f69708..f7bc53a 100644 --- a/mrblib/mtest_unit.rb +++ b/mrblib/mtest_unit.rb @@ -413,7 +413,14 @@ def print *a def puke klass, meth, e # dirty hack to find the actual filename and line number that the assertion failed at - loc = e.backtrace.find(Proc.new {e.inspect}) {|l| !l.include?(':in MTest::')} + loc = e.backtrace.find {|l| !l.include?(':in MTest::')} + if loc + idx = loc.rindex(':in ') + loc = idx.nil? ? "#{loc}: #{e.message}" : "#{loc[0, idx]}: #{e.message} (#{e.class})" + else + loc = e.inspect + end + e = case e when MTest::Skip @skips += 1