Skip to content

Commit

Permalink
Merge pull request #1644 from etalab/move/coverage
Browse files Browse the repository at this point in the history
Moving coverage config to correct place
  • Loading branch information
Samuelfaure authored Aug 27, 2024
2 parents c414c22 + 647e0b6 commit 9d354ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
22 changes: 22 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
# Configuration for simplecov
# Test coverage options (activated only if rspec is run without arguments)
if ARGV.grep(/spec\.rb/).empty? || ENV['CI'] || ENV['COVERAGE']
require 'simplecov'
require 'simplecov-console'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console
]
)

SimpleCov.start 'rails' do
add_filter 'app/jobs/application_job.rb'
add_filter 'app/mailers/application_mailer.rb'
add_filter 'lib/tasks/'
add_filter 'lib/mailer_previews/'
end
end

ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../config/environment', __dir__)

# This file is copied to spec/ when you run 'rails generate rspec:install'
Expand Down
21 changes: 0 additions & 21 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,6 @@
# the additional setup, and require it from the spec files that actually need
# it.

# Configuration for simplecov
# Test coverage options (activated only if rspec is run without arguments)
if ARGV.grep(/spec\.rb/).empty? || ENV['CI'] || ENV['COVERAGE']
require 'simplecov'
require 'simplecov-console'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console
]
)

SimpleCov.start 'rails' do
add_filter 'app/jobs/application_job.rb'
add_filter 'app/mailers/application_mailer.rb'
add_filter 'lib/tasks/'
add_filter 'lib/mailer_previews/'
end
end

require 'rspec/retry'
require 'webmock/rspec'
require 'pundit/rspec'
Expand Down

0 comments on commit 9d354ff

Please sign in to comment.