def post_report(suite)
tally = test_tally(suite)
width = suite.collect{ |tr| tr.name.size }.max
headers = [ 'TESTCASE ', ' TESTS ', 'ASSERTIONS', ' FAILURES ', ' ERRORS ' ]
io.puts "\n%-#{width}s %10s %10s %10s %10s\n" % headers
files = nil
suite.each do |testrun|
if testrun.files != [testrun.name] && testrun.files != files
label = testrun.files.join(' ')
label = Colorize.magenta(label)
io.puts(label + "\n")
files = testrun.files
end
io.puts paint_line(testrun, width)
end
tally_line = "-----\n"
tally_line << "%-#{width}s " % "TOTAL"
tally_line << "%10s %10s %10s %10s" % tally
io.puts(tally_line + "\n")
fails = suite.select do |testrun|
testrun.fail? || testrun.error?
end
unless fails.empty?
io.puts "\n\n-- Failures and Errors --\n\n"
fails.uniq.each do |testrun|
message = testrun.message.tabto(0).strip
message = Colorize.red(message)
io.puts(message+"\n\n")
end
io.puts
end
end