Class: SimpleCov::Formatter::JSONFormatter::ErrorsFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov/formatter/json_formatter/errors_formatter.rb

Overview

Translates the threshold violations reported by ‘SimpleCov::CoverageViolations` into the `:errors` section of coverage.json. Each violation is keyed by criterion (`:lines` / `:branches` / `:methods`) so consumers can render per-criterion messages without re-deriving them.

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ErrorsFormatter

Returns a new instance of ErrorsFormatter.



15
16
17
18
# File 'lib/simplecov/formatter/json_formatter/errors_formatter.rb', line 15

def initialize(result)
  @result = result
  @errors = {}
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
# File 'lib/simplecov/formatter/json_formatter/errors_formatter.rb', line 20

def call
  format_minimum_overall
  format_minimum_by_file
  format_minimum_by_group
  format_maximum_overall
  format_maximum_drop
  @errors
end