Class: Rails::TestUnitReporter
- Inherits:
-
Minitest::StatisticsReporter
- Object
- Minitest::StatisticsReporter
- Rails::TestUnitReporter
- Defined in:
- lib/rails/test_unit/reporter.rb
Instance Method Summary collapse
-
#aggregated_results ⇒ Object
:nodoc:.
- #filtered_results ⇒ Object
- #record(result) ⇒ Object
- #relative_path_for(file) ⇒ Object
- #report ⇒ Object
Instance Method Details
#aggregated_results ⇒ Object
:nodoc:
41 42 43 |
# File 'lib/rails/test_unit/reporter.rb', line 41 def aggregated_results # :nodoc: filtered_results.map { |result| format_rerun_snippet(result) }.join "\n" end |
#filtered_results ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/rails/test_unit/reporter.rb', line 45 def filtered_results if [:verbose] results else results.reject(&:skipped?) end end |
#record(result) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails/test_unit/reporter.rb', line 10 def record(result) super if [:verbose] io.puts color_output(format_line(result), by: result) else io.print color_output(result.result_code, by: result) end if output_inline? && result.failure && (!result.skipped? || [:verbose]) io.puts io.puts io.puts color_output(result, by: result) io.puts io.puts format_rerun_snippet(result) io.puts end if fail_fast? && result.failure && !result.skipped? raise Interrupt end end |
#relative_path_for(file) ⇒ Object
53 54 55 |
# File 'lib/rails/test_unit/reporter.rb', line 53 def relative_path_for(file) file.sub(/^#{app_root}\/?/, "") end |
#report ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/rails/test_unit/reporter.rb', line 33 def report return if output_inline? || filtered_results.empty? io.puts io.puts "Failed tests:" io.puts io.puts aggregated_results end |