Minitest::Reporter
![show/hide quicksearch [+]](../images/find.png)
A reporter that gathers statistics about a test run. Does not do any IO because meant to be used as a parent class for a reporter that does.
If you want to create an entirely different type of output (eg, CI, HTML, etc), this is the place to start.
Example:
class JenkinsCIReporter < StatisticsReporter def report super # Needed to calculate some statistics print "<testsuite " print "tests='#{count}' " print "failures='#{failures}' " # Remaining XML... end end
Time the test run started. If available, the monotonic clock is used and
this is a Float, otherwise it's an instance of
Time.
Test run time. If available, the monotonic clock is
used and this is a Float, otherwise it's an instance of
Time.
Report on the tracked statistics.
 
               # File minitest-5.14.2/lib/minitest.rb, line 730
def report
  aggregate = results.group_by { |r| r.failure.class }
  aggregate.default = [] # dumb. group_by should provide this
  self.total_time = Minitest.clock_time - start_time
  self.failures   = aggregate[Assertion].size
  self.errors     = aggregate[UnexpectedError].size
  self.skips      = aggregate[Skip].size
end