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
:nodoc:.
-
#sync ⇒ Object
:nodoc:.
Attributes inherited from StatisticsReporter
#assertions, #count, #errors, #failures, #results, #skips, #start_time, #total_time, #warnings
Attributes inherited from Reporter
Instance Method Summary collapse
-
#aggregated_results(io) ⇒ Object
:nodoc:.
-
#report ⇒ Object
:nodoc:.
-
#start ⇒ Object
:nodoc:.
-
#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
#initialize, #passed?, #prerecord, #record, #synchronize
Constructor Details
This class inherits a constructor from Minitest::StatisticsReporter
Instance Attribute Details
#old_sync ⇒ Object
:nodoc:
898 899 900 |
# File 'lib/minitest.rb', line 898 def old_sync @old_sync end |
Instance Method Details
#aggregated_results(io) ⇒ Object
:nodoc:
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 |
# File 'lib/minitest.rb', line 929 def aggregated_results io # :nodoc: filtered_results = results.dup filtered_results.reject!(&:skipped?) unless [:verbose] or [:show_skips] skip = [:skip] || [] filtered_results.each_with_index { |result, i| next if skip.include? result.result_code io.puts "\n%3d) %s" % [i+1, result] } io.puts io end |
#report ⇒ Object
:nodoc:
912 913 914 915 916 917 918 919 920 921 922 |
# File 'lib/minitest.rb', line 912 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
:nodoc:
900 901 902 903 904 905 906 907 908 909 910 |
# File 'lib/minitest.rb', line 900 def start # :nodoc: super io.puts "Run options: #{[:args]}" io.puts io.puts "# Running:" io.puts self.sync = io.respond_to? :"sync=" self.old_sync, io.sync = io.sync, true if self.sync end |
#statistics ⇒ Object
:nodoc:
924 925 926 927 |
# File 'lib/minitest.rb', line 924 def statistics # :nodoc: "Finished in %.6fs, %.4f runs/s, %.4f assertions/s." % [total_time, count / total_time, assertions / total_time] end |
#summary ⇒ Object
:nodoc:
949 950 951 952 953 954 955 956 957 958 959 960 961 962 |
# File 'lib/minitest.rb', line 949 def summary # :nodoc: extra = [] extra << ", %d warnings" % [warnings] if [:Werror] extra << "\n\nYou have skipped tests. Run with --verbose for details." if results.any?(&:skipped?) unless [:verbose] or [:show_skips] or ENV["MT_NO_SKIP_MSG"] "%d runs, %d assertions, %d failures, %d errors, %d skips%s" % [count, assertions, failures, errors, skips, extra.join] end |
#to_s ⇒ Object
:nodoc:
945 946 947 |
# File 'lib/minitest.rb', line 945 def to_s # :nodoc: aggregated_results(StringIO.new("".b)).string end |