Class: SimpleCov::ExitCodes::Check
- Inherits:
-
Object
- Object
- SimpleCov::ExitCodes::Check
- Defined in:
- lib/simplecov/exit_codes/check.rb
Overview
Shared skeleton for the threshold checks: stash the result and the
threshold configuration, fail when any violation exists, and
report one message per violation. Subclasses supply exit_code,
compute_violations (memoized here — failing? and report both
consult it), and report_violation.
Direct Known Subclasses
MaximumCoverageDropCheck, MaximumOverallCoverageCheck, MinimumCoverageByFileCheck, MinimumCoverageByGroupCheck, MinimumOverallCoverageCheck
Instance Method Summary collapse
- #failing? ⇒ Boolean
-
#initialize(result, thresholds) ⇒ Check
constructor
A new instance of Check.
- #report ⇒ Object
Constructor Details
#initialize(result, thresholds) ⇒ Check
Returns a new instance of Check.
11 12 13 14 |
# File 'lib/simplecov/exit_codes/check.rb', line 11 def initialize(result, thresholds) @result = result @thresholds = thresholds end |
Instance Method Details
#failing? ⇒ Boolean
16 17 18 |
# File 'lib/simplecov/exit_codes/check.rb', line 16 def failing? violations.any? end |
#report ⇒ Object
20 21 22 |
# File 'lib/simplecov/exit_codes/check.rb', line 20 def report violations.each { |violation| report_violation(violation) } end |