Exception: CovLoupe::CoverageDataProjectStaleError

Inherits:
CoverageDataError show all
Includes:
StalenessFormatterMixin
Defined in:
lib/cov_loupe/errors/errors.rb

Overview

Project-level stale coverage (global) — coverage timestamp older than one or more source files, or new tracked files missing from coverage.

Instance Attribute Summary collapse

Attributes inherited from Error

#original_error

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, original_error = nil, cov_timestamp: nil, newer_files: [], missing_files: [], deleted_files: [], length_mismatch_files: [], unreadable_files: [], resultset_path: nil) ⇒ CoverageDataProjectStaleError

Returns a new instance of CoverageDataProjectStaleError.



149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/cov_loupe/errors/errors.rb', line 149

def initialize(message = nil, original_error = nil, cov_timestamp: nil, newer_files: [],
  missing_files: [], deleted_files: [], length_mismatch_files: [], unreadable_files: [],
  resultset_path: nil)
  super(message, original_error)
  @cov_timestamp = cov_timestamp
  @newer_files = Array(newer_files)
  @missing_files = Array(missing_files)
  @deleted_files = Array(deleted_files)
  @length_mismatch_files = Array(length_mismatch_files)
  @unreadable_files = Array(unreadable_files)
  @resultset_path = resultset_path
end

Instance Attribute Details

#cov_timestampObject (readonly)

Returns the value of attribute cov_timestamp.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def cov_timestamp
  @cov_timestamp
end

#deleted_filesObject (readonly)

Returns the value of attribute deleted_files.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def deleted_files
  @deleted_files
end

#length_mismatch_filesObject (readonly)

Returns the value of attribute length_mismatch_files.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def length_mismatch_files
  @length_mismatch_files
end

#missing_filesObject (readonly)

Returns the value of attribute missing_files.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def missing_files
  @missing_files
end

#newer_filesObject (readonly)

Returns the value of attribute newer_files.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def newer_files
  @newer_files
end

#resultset_pathObject (readonly)

Returns the value of attribute resultset_path.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def resultset_path
  @resultset_path
end

#unreadable_filesObject (readonly)

Returns the value of attribute unreadable_files.



146
147
148
# File 'lib/cov_loupe/errors/errors.rb', line 146

def unreadable_files
  @unreadable_files
end

Instance Method Details

#user_friendly_messageObject



162
163
164
165
166
167
168
169
170
171
# File 'lib/cov_loupe/errors/errors.rb', line 162

def user_friendly_message
  base = "Coverage data stale (project): #{message || default_message}"
  base + formatter.format_project_details(
    newer_files:           @newer_files,
    missing_files:         @missing_files,
    deleted_files:         @deleted_files,
    length_mismatch_files: @length_mismatch_files,
    unreadable_files:      @unreadable_files
  )
end