From 5e34587db521feefc27ffbaa99d1fb28be98d304 Mon Sep 17 00:00:00 2001 From: uu59 Date: Thu, 15 May 2014 13:25:15 +0900 Subject: [PATCH] Generate code coverage report on Circle CI --- spec/spec_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a05908b..618932f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,11 @@ if ENV['RAILS_ENV'] == 'test' require 'simplecov' SimpleCov.start 'rails' + + if ENV['CIRCLE_ARTIFACTS'] # https://circleci.com/docs/code-coverage + dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage") + SimpleCov.coverage_dir(dir) + end end # This file is copied to spec/ when you run 'rails generate rspec:install'