aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-08 12:32:04 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 08:48:03 +0900
commit206af4727c2892e755d1c82fcd211d4712fe658c (patch)
tree38bc3e52944112b08e719773b147659ebe84b883
parent1fd2a66a93a4065b6be725066044107045c81d01 (diff)
downloadruby-206af4727c2892e755d1c82fcd211d4712fe658c.tar.gz
Merge poke methods
-rw-r--r--tool/lib/test/unit.rb34
1 files changed, 15 insertions, 19 deletions
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 = "."