123456789_123456789_123456789_123456789_123456789_

Class: Minitest::SummaryReporter

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Minitest::StatisticsReporter
Defined in: lib/minitest.rb

Overview

A reporter that prints the header, summary, and failure details at the end of the run.

This is added to the top-level CompositeReporter at the start of the run. If you want to change the output of minitest via a plugin, pull this out of the composite and replace it with your own.

Class Method Summary

StatisticsReporter - Inherited

Reporter - Inherited

Instance Attribute Summary

StatisticsReporter - Inherited

Reporter - Inherited

#io

The IO used to report.

#options

Command-line options for this run.

AbstractReporter - Inherited

#passed?

Did this run pass?

Instance Method Summary

StatisticsReporter - Inherited

AbstractReporter - Inherited

#prerecord

About to start running a test.

#record

Record a result and output the Runnable#result_code.

#report

Outputs the summary of the run.

#start

Starts reporting on the run.

Constructor Details

This class inherits a constructor from Minitest::StatisticsReporter

Instance Attribute Details

#old_sync (rw)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 574

attr_accessor :old_sync

#sync (rw)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 573

attr_accessor :sync

Instance Method Details

#aggregated_results(io)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 606

def aggregated_results io # :nodoc:
  filtered_results = results.dup
  filtered_results.reject!(&:skipped?) unless options[:verbose]

  filtered_results.each_with_index { |result, i|
    io.puts "\n%3d) %s" % [i+1, result]
  }
  io.puts
  io
end

#binary_string (private)

See additional method definition at line 634.

[ GitHub ]

  
# File 'lib/minitest.rb', line 636

def binary_string; ''.b; end

#report

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 589

def report # :nodoc:
  super

  io.sync = self.old_sync

  io.puts unless options[:verbose] # finish the dots
  io.puts
  io.puts statistics
  aggregated_results io
  io.puts summary
end

#start

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 577

def start # :nodoc:
  super

  io.puts "Run options: #{options[:args]}"
  io.puts
  io.puts "# Running:"
  io.puts

  self.sync = io.respond_to? :"sync=" # stupid emacs
  self.old_sync, io.sync = io.sync, true if self.sync
end

#statistics

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 601

def statistics # :nodoc:
  "Finished in %.6fs, %.4f runs/s, %.4f assertions/s." %
    [total_time, count / total_time, assertions / total_time]
end

#summary

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 621

def summary # :nodoc:
  extra = ""

  extra = "\n\nYou have skipped tests. Run with --verbose for details." if
    results.any?(&:skipped?) unless options[:verbose] or ENV["MT_NO_SKIP_MSG"]

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

#to_s

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 617

def to_s # :nodoc:
  aggregated_results(StringIO.new(binary_string)).string
end