Class: SimpleCov::ExitCodes::MaximumCoverageDropCheck
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/simplecov/exit_codes/maximum_coverage_drop_check.rb |
Class Method Summary
Instance Attribute Summary
- #failing? ⇒ Boolean readonly
Instance Method Summary
- #exit_code
- #report
- #violations private
Constructor Details
.new(result, maximum_coverage_drop) ⇒ MaximumCoverageDropCheck
Instance Attribute Details
#failing? ⇒ Boolean (readonly)
[ GitHub ]
# File 'lib/simplecov/exit_codes/maximum_coverage_drop_check.rb', line 11
def failing? violations.any? end
Instance Method Details
#exit_code
[ GitHub ]# File 'lib/simplecov/exit_codes/maximum_coverage_drop_check.rb', line 26
def exit_code SimpleCov::ExitCodes::MAXIMUM_COVERAGE_DROP end
#report
[ GitHub ]# File 'lib/simplecov/exit_codes/maximum_coverage_drop_check.rb', line 15
def report violations.each do |violation| $stderr.printf( "%<criterion>s coverage has dropped by %<drop_percent>.2f%% since the last time (maximum allowed: %<max_drop>.2f%%).\n", criterion: violation.fetch(:criterion).capitalize, drop_percent: violation.fetch(:actual), max_drop: violation.fetch(:maximum) ) end end
#violations (private)
[ GitHub ]# File 'lib/simplecov/exit_codes/maximum_coverage_drop_check.rb', line 32
def violations @violations ||= SimpleCov::CoverageViolations.maximum_drop(@result, @maximum_coverage_drop) end