diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test/unit.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 7b3554cbed..9d676b18ff 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -735,13 +735,21 @@ module Test # TODO: # this overriding is for minitest feature that skip messages are # hidden when not verbose (-v), note this is temporally. - n = report.size - rep = super - if MiniTest::Skip === e and /no message given\z/ =~ e.message - report.slice!(n..-1) - rep = "." - end - rep + e = case e + when MiniTest::Skip then + @skips += 1 + return "." if /no message given\z/ =~ e.message + "Skipped:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n" + when MiniTest::Assertion then + @failures += 1 + "Failure:\n#{meth}(#{klass}) [#{location e}]:\n#{e.message}\n" + else + @errors += 1 + bt = MiniTest::filter_backtrace(e.backtrace).join "\n " + "Error:\n#{meth}(#{klass}):\n#{e.class}: #{e.message}\n #{bt}\n" + end + @report << e + e[0, 1] end def initialize # :nodoc: |