summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:53:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:53:56 +0000
commitec76e156feeb28b59de8fdc40ff0c40d6d44a378 (patch)
tree02cc9656bf447d0da271f7de2da7ed730a3f5cce
parenta6003269b6a8c80496141c91c778d169386da486 (diff)
lib/test/unit.rb: refactoring puke
* lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and drop useless reports, not override entirely. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit.rb22
2 files changed, 11 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index f9832ce0ec0..20238d13ac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue May 8 03:53:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 8 03:53:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (Test::Unit::Runner#puke): modify only result and
+ drop useless reports, not override entirely.
* bootstraptest/runner.rb (exec_test, show_progress): show rotators
and pass/fail counts.
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index ac15a95b077..b009edb6c0a 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -650,21 +650,13 @@ module Test
# TODO:
# this overriding is for minitest feature that skip messages are
# hidden when not verbose (-v), note this is temporally.
- 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]
+ n = report.size
+ rep = super
+ if MiniTest::Skip === e and /no message given\z/ =~ e.message
+ report.slice!(n..-1)
+ rep = "."
+ end
+ rep
end
def initialize # :nodoc: