diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 4a89cca5b2..df2998199a 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -1433,24 +1433,6 @@ module Test # Writes status for failed test +meth+ in +klass+ which finished with # exception +e+ - def puke klass, meth, e - e = case e - when MiniTest::Skip then - @skips += 1 - return "S" unless @verbose - "Skipped:\n#{klass}##{meth} [#{location e}]:\n#{e.message}\n" - when MiniTest::Assertion then - @failures += 1 - "Failure:\n#{klass}##{meth} [#{location e}]:\n#{e.message}\n" - else - @errors += 1 - bt = MiniTest::filter_backtrace(e.backtrace).join "\n " - "Error:\n#{klass}##{meth}:\n#{e.class}: #{e.message.b}\n #{bt}\n" - end - @report << e - e[0, 1] - end - def initialize # :nodoc: @report = [] @errors = @failures = @skips = 0 @@ -1588,7 +1570,21 @@ module Test # this overriding is for minitest feature that skip messages are # hidden when not verbose (-v), note this is temporally. n = report.size - rep = super + e = case e + when MiniTest::Skip then + @skips += 1 + return "S" unless @verbose + "Skipped:\n#{klass}##{meth} [#{location e}]:\n#{e.message}\n" + when MiniTest::Assertion then + @failures += 1 + "Failure:\n#{klass}##{meth} [#{location e}]:\n#{e.message}\n" + else + @errors += 1 + bt = MiniTest::filter_backtrace(e.backtrace).join "\n " + "Error:\n#{klass}##{meth}:\n#{e.class}: #{e.message.b}\n #{bt}\n" + end + @report << e + rep = e[0, 1] if MiniTest::Skip === e and /no message given\z/ =~ e.message report.slice!(n..-1) rep = "."