Class: SimpleCov::RSpec::UncoveredReport Private
- Inherits:
-
Object
- Object
- SimpleCov::RSpec::UncoveredReport
- Defined in:
- lib/simplecov-rspec/uncovered_report.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.
Formats the "uncovered lines/branches/methods" report printed after a run: either a full listing of every uncovered item, or a per-criterion count with a hint on how to see the details.
Constant Summary collapse
- CRITERION_LABELS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Maps a coverage criterion to its [singular, plural] noun, for report formatting
{ line: %w[line lines], branch: %w[branch branches], method: %w[method methods] }.freeze
Instance Method Summary collapse
-
#initialize(result:, criteria:, detail:, detail_env_var:, files: nil) ⇒ UncoveredReport
constructor
private
Build a report for the given result, criteria, and detail level.
-
#to_s ⇒ String
private
The formatted report text, or an empty string if there is nothing to report.
Constructor Details
#initialize(result:, criteria:, detail:, detail_env_var:, files: nil) ⇒ UncoveredReport
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.
Build a report for the given result, criteria, and detail level
28 29 30 31 32 33 34 |
# File 'lib/simplecov-rspec/uncovered_report.rb', line 28 def initialize(result:, criteria:, detail:, detail_env_var:, files: nil) @result = result @criteria = criteria @detail = detail @detail_env_var = detail_env_var @files = files end |
Instance Method Details
#to_s ⇒ 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.
The formatted report text, or an empty string if there is nothing to report
A scoped report (one where files is not nil) always produces text, even when
every file it covers is fully covered. Silence there would be indistinguishable
from a clean run of the whole suite, which is the opposite of what asking for a
scope means.
44 |
# File 'lib/simplecov-rspec/uncovered_report.rb', line 44 def to_s = files.nil? ? uncovered_text : scoped_text |