Class: SimpleCov::ExitCodes::MaximumOverallCoverageCheck
- Inherits:
-
Object
- Object
- SimpleCov::ExitCodes::MaximumOverallCoverageCheck
- Defined in:
- lib/simplecov/exit_codes/maximum_overall_coverage_check.rb
Overview
Fails when the overall (project-wide) coverage for any criterion is above the configured maximum. Pair with ‘SimpleCov::ExitCodes::MinimumOverallCoverageCheck` (or use `SimpleCov.expected_coverage`) to pin coverage to an exact value and surface unexpected increases instead of silently absorbing them.
Instance Method Summary collapse
- #exit_code ⇒ Object
- #failing? ⇒ Boolean
-
#initialize(result, maximum_coverage) ⇒ MaximumOverallCoverageCheck
constructor
A new instance of MaximumOverallCoverageCheck.
- #report ⇒ Object
Constructor Details
#initialize(result, maximum_coverage) ⇒ MaximumOverallCoverageCheck
Returns a new instance of MaximumOverallCoverageCheck.
11 12 13 14 |
# File 'lib/simplecov/exit_codes/maximum_overall_coverage_check.rb', line 11 def initialize(result, maximum_coverage) @result = result @maximum_coverage = maximum_coverage end |
Instance Method Details
#exit_code ⇒ Object
24 25 26 |
# File 'lib/simplecov/exit_codes/maximum_overall_coverage_check.rb', line 24 def exit_code SimpleCov::ExitCodes::MAXIMUM_COVERAGE end |
#failing? ⇒ Boolean
16 17 18 |
# File 'lib/simplecov/exit_codes/maximum_overall_coverage_check.rb', line 16 def failing? violations.any? end |
#report ⇒ Object
20 21 22 |
# File 'lib/simplecov/exit_codes/maximum_overall_coverage_check.rb', line 20 def report violations.each { |violation| report_violation(violation) } end |