class Minitest::StatisticsReporter
def initialize io = $stdout, options = {} # :nodoc:
def initialize io = $stdout, options = {} # :nodoc: super self.assertions = 0 self.count = 0 self.results = [] self.start_time = nil self.total_time = nil self.failures = nil self.errors = nil self.warnings = nil self.skips = nil end
def passed? # :nodoc:
def passed? # :nodoc: results.all?(&:skipped?) end
def record result # :nodoc:
def record result # :nodoc: self.count += 1 self.assertions += result.assertions results << result if not result.passed? or result.skipped? end
def report
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.warnings = aggregate[UnexpectedWarning].size self.skips = aggregate[Skip].size end
def start # :nodoc:
def start # :nodoc: self.start_time = Minitest.clock_time end