mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Merge poke methods
This commit is contained in:
parent
1fd2a66a93
commit
206af4727c
Notes:
git
2021-09-11 08:48:39 +09:00
1 changed files with 15 additions and 19 deletions
|
@ -1433,24 +1433,6 @@ module Test
|
||||||
# Writes status for failed test +meth+ in +klass+ which finished with
|
# Writes status for failed test +meth+ in +klass+ which finished with
|
||||||
# exception +e+
|
# 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:
|
def initialize # :nodoc:
|
||||||
@report = []
|
@report = []
|
||||||
@errors = @failures = @skips = 0
|
@errors = @failures = @skips = 0
|
||||||
|
@ -1588,7 +1570,21 @@ module Test
|
||||||
# this overriding is for minitest feature that skip messages are
|
# this overriding is for minitest feature that skip messages are
|
||||||
# hidden when not verbose (-v), note this is temporally.
|
# hidden when not verbose (-v), note this is temporally.
|
||||||
n = report.size
|
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
|
if MiniTest::Skip === e and /no message given\z/ =~ e.message
|
||||||
report.slice!(n..-1)
|
report.slice!(n..-1)
|
||||||
rep = "."
|
rep = "."
|
||||||
|
|
Loading…
Reference in a new issue