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(io) ⇒ Object
:nodoc:.
-
#report ⇒ Object
:nodoc:.
-
#start ⇒ Object
:startdoc:.
-
#statistics ⇒ Object
:nodoc:.
-
#summary ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Methods inherited from StatisticsReporter
#initialize, #passed?, #record
Methods inherited from Reporter
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.
574 575 576 |
# File 'lib/minitest.rb', line 574 def old_sync @old_sync end |
Instance Method Details
#aggregated_results(io) ⇒ Object
:nodoc:
606 607 608 609 610 611 612 613 614 615 |
# File 'lib/minitest.rb', line 606 def aggregated_results io # :nodoc: filtered_results = results.dup filtered_results.reject!(&:skipped?) unless [:verbose] filtered_results.each_with_index { |result, i| io.puts "\n%3d) %s" % [i+1, result] } io.puts io end |
#report ⇒ Object
:nodoc:
589 590 591 592 593 594 595 596 597 598 599 |
# File 'lib/minitest.rb', line 589 def report # :nodoc: super io.sync = self.old_sync io.puts unless [:verbose] # finish the dots io.puts io.puts statistics aggregated_results io io.puts summary end |
#start ⇒ Object
:startdoc:
577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/minitest.rb', line 577 def start # :nodoc: super io.puts "Run 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 ⇒ Object
:nodoc:
601 602 603 604 |
# 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 ⇒ Object
:nodoc:
621 622 623 624 625 626 627 628 629 |
# 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 [: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 ⇒ Object
:nodoc:
617 618 619 |
# File 'lib/minitest.rb', line 617 def to_s # :nodoc: aggregated_results(StringIO.new(binary_string)).string end |