Class: RSpecTracer::Reporters::TerminalReporter Private

Inherits:
Base
  • Object
show all
Defined in:
lib/rspec_tracer/reporters/terminal_reporter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Concise stdout summary printed at finalize-time. Output is capped at 4 lines for a typical run (5 when duplicate / interrupted / flaky / pending counters are non-zero). Kind-less taxonomy by design - the in-memory Input#kind enum does not survive Storage::Snapshot persistence, so breaking down “Changed files: Templates / Locales / Ruby” would require a schema bump (deferred).

Color policy:

- Respects `NO_COLOR` per https://no-color.org/ (any value
  disables, even empty string).
- Emits ANSI codes only when the output stream reports tty?.
- The header line paints red on any failure / interrupted,
  yellow on pending-only, green otherwise.

Instance Attribute Summary

Attributes inherited from Base

#logger, #options, #report_dir, #run_metadata, #snapshot

Instance Method Summary collapse

Methods inherited from Base

#initialize, #no_op?

Constructor Details

This class inherits a constructor from RSpecTracer::Reporters::Base

Instance Method Details

#generateArray<String>?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Concrete implementation of Base#generate. Prints a per-run summary to the configured output stream.

Returns:

  • (Array<String>, nil)

    the lines emitted, or nil when the run had no examples worth reporting.



63
64
65
66
67
68
69
70
# File 'lib/rspec_tracer/reporters/terminal_reporter.rb', line 63

def generate
  return nil if no_op?

  lines = build_lines
  stream = output_stream
  lines.each { |line| stream.puts line }
  lines
end