Created
April 10, 2016 18:21
-
-
Save BitOfUniverse/c2d98ff2d4ffb108444873225ae2f39a to your computer and use it in GitHub Desktop.
Use CodeClimate + Coversall + SimpleCov locally at the same time
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
# Allows to post coverage data to remote services like Codeclimate & Coversall and use simplecov locally | |
# to view coverage locally, run: rake spec COV=true | |
# add file on the top for spec_helper: require 'coverage_reporters.rb' | |
require 'simplecov' | |
require 'coveralls' | |
require "codeclimate-test-reporter" | |
reporters = [ | |
(Coveralls::SimpleCov::Formatter if Coveralls.will_run?), | |
(CodeClimate::TestReporter::Formatter if CodeClimate::TestReporter.run?), | |
(SimpleCov::Formatter::HTMLFormatter if ENV['COV']) | |
].compact | |
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(reporters) | |
SimpleCov.start 'rails' unless reporters.empty? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment