Class: SimpleCov::ExitCodes::MinimumOverallCoverageCheck
- Inherits:
-
Object
- Object
- SimpleCov::ExitCodes::MinimumOverallCoverageCheck
- Defined in:
- lib/simplecov/exit_codes/minimum_overall_coverage_check.rb
Instance Method Summary collapse
- #exit_code ⇒ Object
- #failing? ⇒ Boolean
-
#initialize(result, minimum_coverage) ⇒ MinimumOverallCoverageCheck
constructor
A new instance of MinimumOverallCoverageCheck.
- #report ⇒ Object
Constructor Details
#initialize(result, minimum_coverage) ⇒ MinimumOverallCoverageCheck
Returns a new instance of MinimumOverallCoverageCheck.
6 7 8 9 |
# File 'lib/simplecov/exit_codes/minimum_overall_coverage_check.rb', line 6 def initialize(result, minimum_coverage) @result = result @minimum_coverage = minimum_coverage end |
Instance Method Details
#exit_code ⇒ Object
26 27 28 |
# File 'lib/simplecov/exit_codes/minimum_overall_coverage_check.rb', line 26 def exit_code SimpleCov::ExitCodes::MINIMUM_COVERAGE end |
#failing? ⇒ Boolean
11 12 13 |
# File 'lib/simplecov/exit_codes/minimum_overall_coverage_check.rb', line 11 def failing? minimum_violations.any? end |
#report ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simplecov/exit_codes/minimum_overall_coverage_check.rb', line 15 def report minimum_violations.each do |violation| $stderr.printf( "%<criterion>s coverage (%<covered>.2f%%) is below the expected minimum coverage (%<minimum_coverage>.2f%%).\n", covered: SimpleCov.round_coverage(violation.fetch(:actual)), minimum_coverage: violation.fetch(:minimum_expected), criterion: violation.fetch(:criterion).capitalize ) end end |