Sha256: da1ef0f72807f9d81971cf1fda192d3fd194cff932e0f3b9f31f780f50277029
Contents?: true
Size: 561 Bytes
Versions: 5
Compression:
Stored size: 561 Bytes
Contents
# coding: utf-8 MINIMUM_COVERAGE = 85 desc "Check if test coverage is equal or greater than %.2f%%" % MINIMUM_COVERAGE task :coverage => :spec do require 'simplecov' require 'simplecov/exit_codes' covered_percent = SimpleCov.result.covered_percent.round(2) if covered_percent < MINIMUM_COVERAGE $stderr.puts "Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%)." % \ [covered_percent, MINIMUM_COVERAGE] exit(SimpleCov::ExitCodes::MINIMUM_COVERAGE) end end task :clean do FileUtils.rm_rf 'coverage' end
Version data entries
5 entries across 5 versions & 1 rubygems