Exception: CovLoupe::CoverageDataStaleError

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

Overview

Coverage data is present but appears stale compared to source files

Instance Attribute Summary collapse

Attributes inherited from Error

#original_error

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, original_error = nil, file_path: nil, file_mtime: nil, cov_timestamp: nil, src_len: nil, cov_len: nil, resultset_path: nil) ⇒ CoverageDataStaleError

Returns a new instance of CoverageDataStaleError.



115
116
117
118
119
120
121
122
123
124
# File 'lib/cov_loupe/errors/errors.rb', line 115

def initialize(message = nil, original_error = nil, file_path: nil, file_mtime: nil,
  cov_timestamp: nil, src_len: nil, cov_len: nil, resultset_path: nil)
  @file_path = file_path
  @file_mtime = file_mtime
  @cov_timestamp = cov_timestamp
  @src_len = src_len
  @cov_len = cov_len
  @resultset_path = resultset_path
  super(message || default_message, original_error)
end

Instance Attribute Details

#cov_lenObject (readonly)

Returns the value of attribute cov_len.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def cov_len
  @cov_len
end

#cov_timestampObject (readonly)

Returns the value of attribute cov_timestamp.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def cov_timestamp
  @cov_timestamp
end

#file_mtimeObject (readonly)

Returns the value of attribute file_mtime.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def file_mtime
  @file_mtime
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def file_path
  @file_path
end

#resultset_pathObject (readonly)

Returns the value of attribute resultset_path.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def resultset_path
  @resultset_path
end

#src_lenObject (readonly)

Returns the value of attribute src_len.



113
114
115
# File 'lib/cov_loupe/errors/errors.rb', line 113

def src_len
  @src_len
end

Instance Method Details

#user_friendly_messageObject



126
127
128
129
130
131
132
133
# File 'lib/cov_loupe/errors/errors.rb', line 126

def user_friendly_message
  "Coverage data stale: #{message}" + formatter.format_single_file_details(
    file_path:  @file_path,
    file_mtime: @file_mtime,
    src_len:    @src_len,
    cov_len:    @cov_len
  )
end