class Tunit::SummaryReporter

Constants

SKIP_MSG

Public Instance Methods

report() click to toggle source
Calls superclass method Tunit::Reporter#report
# File lib/tunit/summary_reporter.rb, line 16
def report
  super

  io.puts unless options[:verbose]
  io.puts
  io.puts statistics
  io.puts aggregated_results
  io.puts summary
end
start() click to toggle source
Calls superclass method Tunit::Reporter#start
# File lib/tunit/summary_reporter.rb, line 7
def start
  super

  io.puts "Run options: #{options.inspect}"
  io.puts
  io.puts "# Running:"
  io.puts
end

Private Instance Methods

aggregated_results() click to toggle source
# File lib/tunit/summary_reporter.rb, line 33
def aggregated_results
  filtered_results = results.dup
  filtered_results.reject!(&:skipped?) unless options[:verbose]

  filtered_results.each_with_index.map do |result, index|
    "\n%3d) %s" % [index + 1, result]
  end.join + "\n"
end
statistics() click to toggle source
# File lib/tunit/summary_reporter.rb, line 28
def statistics
  "Finished in %.6fs, %.4f runs/s, %.4f assertions/s." %
    [total_time, count / total_time, assertions / total_time]
end
summary() click to toggle source
# File lib/tunit/summary_reporter.rb, line 42
def summary
  extra = ""
  extra << SKIP_MSG if results.any?(&:skipped?) && !options[:verbose]

  "%d runs, %d assertions, %d failures, %d skips%s" %
    [count, assertions, failures, skips, extra]
end