Skip to content

Instantly share code, notes, and snippets.

@BitOfUniverse
Created April 10, 2016 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BitOfUniverse/c2d98ff2d4ffb108444873225ae2f39a to your computer and use it in GitHub Desktop.
Save BitOfUniverse/c2d98ff2d4ffb108444873225ae2f39a to your computer and use it in GitHub Desktop.
Use CodeClimate + Coversall + SimpleCov locally at the same time
# 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