From a3d6493ea6e6f6b157edecf55b23e7182ab7aff5 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Sun, 6 Jul 2014 23:27:50 +0200 Subject: [PATCH] Allow to collect coverage information locally --- spec/spec_helper.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f6f3859f..dd9400f6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,14 @@ -require 'coveralls' -Coveralls.wear!('rails') # This file is copied to spec/ when you run 'rails generate rspec:install' +require 'simplecov' + +if ENV['TRAVIS'] + require 'coveralls' + SimpleCov.formatter = Coveralls::SimpleCov::Formatter + Coveralls.wear!('rails') +else + SimpleCov.start 'rails' +end + ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__)