class Minitest::StatisticsReporter

def initialize io = $stdout, options = {} # :nodoc:

: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.skips      = nil
end

def passed? # :nodoc:

:nodoc:
def passed? # :nodoc:
  results.all?(&:skipped?)
end

def record result # :nodoc:

:nodoc:
def record result # :nodoc:
  self.count += 1
  self.assertions += result.assertions
  results << result if not result.passed? or result.skipped?
end

def report # :nodoc:

:nodoc:
def report # :nodoc:
  aggregate = results.group_by { |r| r.failure.class }
  aggregate.default = [] # dumb. group_by should provide this
  self.total_time = Time.now - start_time
  self.failures   = aggregate[Assertion].size
  self.errors     = aggregate[UnexpectedError].size
  self.skips      = aggregate[Skip].size
end

def start # :nodoc:

:nodoc:
def start # :nodoc:
  self.start_time = Time.now
end