Class: Verity::Reporters::DotsReporter
- Inherits:
-
Object
- Object
- Verity::Reporters::DotsReporter
- Includes:
- Verity::Reporter
- Defined in:
- lib/verity/reporters/dots_reporter.rb
Overview
Public: Minimal reporter that prints a single character per test: “.” for pass, “F” for failure, “E” for error. No color.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(io = $stdout) ⇒ DotsReporter
constructor
Public: Create a new DotsReporter.
-
#on_parallel_complete(counts:, problem_rows:) ⇒ Object
Public: Delegate to ParallelSummaryReporter for the multi-worker summary.
-
#on_run_finish(summary:, worker_id:) ⇒ Object
Public: Print the final summary line with counts.
-
#on_test_complete(result:, worker_id:) ⇒ Object
Public: Print a dot, F, E, or S (skip) for the completed test.
Methods included from Verity::Reporter
Constructor Details
#initialize(io = $stdout) ⇒ DotsReporter
Public: Create a new DotsReporter.
io - IO object for output (default $stdout).
13 14 15 |
# File 'lib/verity/reporters/dots_reporter.rb', line 13 def initialize(io = $stdout) @io = io end |
Instance Method Details
#on_parallel_complete(counts:, problem_rows:) ⇒ Object
Public: Delegate to ParallelSummaryReporter for the multi-worker summary.
43 44 45 |
# File 'lib/verity/reporters/dots_reporter.rb', line 43 def on_parallel_complete(counts:, problem_rows:) ParallelSummaryReporter.new(@io).emit(counts:, problem_rows:) end |
#on_run_finish(summary:, worker_id:) ⇒ Object
Public: Print the final summary line with counts.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/verity/reporters/dots_reporter.rb', line 31 def on_run_finish(summary:, worker_id:) t = summary[:total] p = summary[:passed] f = summary[:failed] e = summary[:errored] line = "\n\n#{t} tests: #{p} passed, #{f} failed, #{e} errored" line += ", #{summary[:skipped]} skipped" if summary[:skipped].to_i.positive? line += " (focus)" if summary[:focus] @io.puts line end |
#on_test_complete(result:, worker_id:) ⇒ Object
Public: Print a dot, F, E, or S (skip) for the completed test.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/verity/reporters/dots_reporter.rb', line 18 def on_test_complete(result:, worker_id:) char = case result.status when :pass then "." when :fail then "F" when :error then "E" when :skip then "S" end @io.print char @io.flush end |