Created
August 21, 2014 12:41
-
-
Save opahk/d6d4e6bc51aef4d865c8 to your computer and use it in GitHub Desktop.
code coverage build thresholds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec cane --no-doc --gte "path/to/coverage/covered_percent,99" --lte "path/to/coverage/missed_lines,28" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SimpleCov::Formatter::QualityFormatter | |
def format(result) | |
SimpleCov::Formatter::HTMLFormatter.new.format(result) | |
File.open("#{SimpleCov.coverage_dir}/covered_percent", 'w') do |f| | |
f.puts result.source_files.covered_percent.to_f | |
end | |
File.open("#{SimpleCov.coverage_dir}/missed_lines", 'w') do |f| | |
f.puts result.source_files.missed_lines | |
end | |
end | |
end | |
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment