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. This emits a single warning summarizing the drop and, when every entry was lost, points at the typical cause: SimpleCov.collate invoked from a machine or path different from where the resultsets were generated (#980).

Instance Method Summary collapse

Constructor Details

#initialize(missing_paths, every_entry_dropped:) ⇒ MissingSourceFilesReporter

Returns a new instance of MissingSourceFilesReporter.



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

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

Instance Method Details

#messageObject



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

def message
  @every_entry_dropped ? all_missing_warning : partial_missing_warning
end

#warn!Object



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

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