def finish_suite(suite)
io.puts("\nFinished in %.5f seconds." % [Time.now - @time])
report = ''
list = []
suite.each do |testcase|
testcase.each do |testunit|
if testunit.fail? || testunit.error?
list << testunit
end
end
end
unless list.empty?
list.uniq.each do |testunit|
message = testunit.fail? ? ' ' + FAIL : ERROR
message = message + ' ' + testunit.message.tabto(0)
backtrace = filter_backtrace(testunit.backtrace)
message << "\n" + (backtrace.shift || '')
if @trace
message << "\n" + backtrace.join("\n")
end
report << "\n" << message << "\n"
end
report << "\n"
end
io.puts report
count = test_tally(suite)
tally = "%s tests, %s assertions, %s failures, %s errors" % count
if count[-1] > 0 or count[-2] > 0
tally = Colorize.red(tally)
else
tally = Colorize.green(tally)
end
io.puts tally
end