Class: SimpleCov::Result::MissingSourceFilesReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov/result/missing_source_files_reporter.rb

Overview

When a resultset references source files that don’t exist on the local filesystem they’re silently dropped — which produces an empty ‘0 / 0 (100.00%)` report that looks like success but isn’t. Emit a single warning summarizing the drop and, when every entry was lost, point at the typical cause (‘SimpleCov.collate` invoked from a machine or path different from where the resultsets were generated). See #980.

Instance Method Summary collapse

Constructor Details

#initialize(missing_paths, input_size:, every_entry_dropped:) ⇒ MissingSourceFilesReporter

Returns a new instance of MissingSourceFilesReporter.



12
13
14
15
16
# File 'lib/simplecov/result/missing_source_files_reporter.rb', line 12

def initialize(missing_paths, input_size:, every_entry_dropped:)
  @missing_paths = missing_paths
  @input_size = input_size
  @every_entry_dropped = every_entry_dropped
end

Instance Method Details

#messageObject



22
23
24
# File 'lib/simplecov/result/missing_source_files_reporter.rb', line 22

def message
  @every_entry_dropped ? all_missing_warning : partial_missing_warning
end

#warn!Object



18
19
20
# File 'lib/simplecov/result/missing_source_files_reporter.rb', line 18

def warn!
  warn SimpleCov::Color.colorize(message, :yellow)
end