123456789_123456789_123456789_123456789_123456789_

Module: SimpleCov::ExitCodes::ExitCodeHandling

Relationships & Source Files
Defined in: lib/simplecov/exit_codes/exit_code_handling.rb

Class Method Summary

Class Method Details

.call(result, coverage_limits:) (mod_func)

[ GitHub ]

  
# File 'lib/simplecov/exit_codes/exit_code_handling.rb', line 8

def call(result, coverage_limits:)
  checks = coverage_checks(result, coverage_limits)

  failing_check = checks.find(&:failing?)
  if failing_check
    failing_check.report
    failing_check.exit_code
  else
    SimpleCov::ExitCodes::SUCCESS
  end
end

.coverage_checks(result, coverage_limits) (mod_func)

[ GitHub ]

  
# File 'lib/simplecov/exit_codes/exit_code_handling.rb', line 20

def coverage_checks(result, coverage_limits)
  [
    MinimumOverallCoverageCheck.new(result, coverage_limits.minimum_coverage),
    MinimumCoverageByFileCheck.new(result, coverage_limits.minimum_coverage_by_file),
    MaximumCoverageDropCheck.new(result, coverage_limits.maximum_coverage_drop)
  ]
end