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 = []
message << (testunit.fail? ? FAIL : ERROR)
message << testunit.message.tabto(2)
message << clean_backtrace(testunit.backtrace).join("\n").tabto(2)
report << "\n" << message.join("\n") << "\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