Skip to content

Commit

Permalink
Don't calculate coverage on the generated test app
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 12, 2017
1 parent 1f94e5e commit 1bd426d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# frozen_string_literal: true
ENV['RAILS_ENV'] ||= 'test'

require 'coveralls'
Coveralls.wear!
def coverage_needed?
ENV['COVERAGE'] || ENV['TRAVIS']
end

if coverage_needed?
require 'simplecov'
require 'coveralls'
SimpleCov.root(File.expand_path('../..', __FILE__))
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start('rails') do
add_filter '/.internal_test_app'
add_filter '/lib/generators'
add_filter '/spec'
end
SimpleCov.command_name 'spec'
end

require 'engine_cart'
EngineCart.load_application!

Expand Down

0 comments on commit 1bd426d

Please sign in to comment.