Created
September 11, 2013 17:52
-
-
Save TALlama/6527241 to your computer and use it in GitHub Desktop.
Using CodeClimate's coverage reporting alongside an existing formatter.
This file contains 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
require "codeclimate-test-reporter" | |
CodeClimate::TestReporter.start | |
# output Rcov-style coverage files | |
require 'simplecov' | |
require 'simplecov-rcov' | |
class SimpleCov::Formatter::MergedFormatter | |
def format(result) | |
require "codeclimate-test-reporter" | |
CodeClimate::TestReporter::Formatter.new.format(result) | |
SimpleCov::Formatter::RcovFormatter.new.format(result) | |
end | |
end | |
SimpleCov.formatter = if ENV['CODECLIMATE_REPO_TOKEN'] | |
SimpleCov::Formatter::MergedFormatter | |
else | |
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment