Class: Minitest::SummaryReporter
- Inherits:
-
StatisticsReporter
- Object
- AbstractReporter
- Reporter
- StatisticsReporter
- Minitest::SummaryReporter
- 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.
Instance Attribute Summary collapse
-
#old_sync ⇒ Object
Returns the value of attribute old_sync.
-
#sync ⇒ Object
:stopdoc:.
Attributes inherited from StatisticsReporter
#assertions, #count, #errors, #failures, #results, #skips, #start_time, #total_time
Attributes inherited from Reporter
Instance Method Summary collapse
-
#aggregated_results ⇒ Object
:nodoc:.
-
#report ⇒ Object
:nodoc:.
-
#start ⇒ Object
:startdoc:.
-
#statistics ⇒ Object
:nodoc:.
-
#summary ⇒ Object
:nodoc:.
Methods inherited from StatisticsReporter
#initialize, #passed?, #record
Methods inherited from Reporter
#initialize, #record, #simple_record, synchronize
Methods inherited from AbstractReporter
Constructor Details
This class inherits a constructor from Minitest::StatisticsReporter
Instance Attribute Details
#old_sync ⇒ Object
Returns the value of attribute old_sync.
639 640 641 |
# File 'lib/minitest.rb', line 639 def old_sync @old_sync end |
Instance Method Details
#aggregated_results ⇒ Object
:nodoc:
665 666 667 668 669 670 671 672 |
# File 'lib/minitest.rb', line 665 def aggregated_results # :nodoc: filtered_results = results.dup filtered_results.reject!(&:skipped?) unless [:verbose] filtered_results.each_with_index.map do |result, i| "\n%3d) %s" % [i+1, result] end.join("\n") + "\n" end |
#report ⇒ Object
:nodoc:
649 650 651 652 653 654 655 656 657 658 659 |
# File 'lib/minitest.rb', line 649 def report # :nodoc: super io.sync = self.old_sync io.puts # finish the dots io.puts io.puts statistics io.puts aggregated_results io.puts summary end |
#start ⇒ Object
:startdoc:
642 643 644 645 646 647 |
# File 'lib/minitest.rb', line 642 def start # :nodoc: super self.sync = io.respond_to? :"sync=" # stupid emacs self.old_sync, io.sync = io.sync, true if self.sync end |
#statistics ⇒ Object
:nodoc:
661 662 663 |
# File 'lib/minitest.rb', line 661 def statistics # :nodoc: "Finished in #{ChronicDuration.output(total_time.round) || '0s'}" end |
#summary ⇒ Object
:nodoc:
674 675 676 677 |
# File 'lib/minitest.rb', line 674 def summary # :nodoc: "%d runs, %d assertions, %d failures, %d errors, %d skips" % [count, assertions, failures, errors, skips] end |