|
1 | 1 | # frozen_string_literal: true
|
2 | 2 |
|
3 |
| -require "simplecov" |
4 |
| -require "simplecov-json" |
| 3 | +if ENV["COVERAGE"] |
| 4 | + require "simplecov" |
| 5 | + require "simplecov-json" |
5 | 6 |
|
6 |
| -SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ |
7 |
| - SimpleCov::Formatter::HTMLFormatter, |
8 |
| - SimpleCov::Formatter::JSONFormatter |
9 |
| - ]) |
| 7 | + SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ |
| 8 | + SimpleCov::Formatter::HTMLFormatter, |
| 9 | + SimpleCov::Formatter::JSONFormatter |
| 10 | + ]) |
10 | 11 |
|
11 |
| -SimpleCov.start do |
12 |
| - add_filter "/spec/" |
13 |
| - add_filter(/_spec\.rb$/) # This line excludes all files ending with _spec.rb |
| 12 | + SimpleCov.start do |
| 13 | + add_filter "/spec/" |
| 14 | + add_filter(/_spec\.rb$/) # This line excludes all files ending with _spec.rb |
14 | 15 |
|
15 |
| - add_group "Sidekiq jobs" do |src_file| |
16 |
| - src_file.project_filename =~ %r{lib/interactify/async} && src_file.filename !~ /_spec\.rb/ |
17 |
| - end |
| 16 | + add_group "Sidekiq jobs" do |src_file| |
| 17 | + src_file.project_filename =~ %r{lib/interactify/async} && src_file.filename !~ /_spec\.rb/ |
| 18 | + end |
18 | 19 |
|
19 |
| - add_group "Wiring", "lib/interactify/wiring" |
20 |
| - add_group "RSpec matchers", "lib/interactify/rspec_matchers" |
| 20 | + add_group "Wiring", "lib/interactify/wiring" |
| 21 | + add_group "RSpec matchers", "lib/interactify/rspec_matchers" |
21 | 22 |
|
22 |
| - coverage_dir "coverage/#{ENV.fetch('RUBY_VERSION', nil)}-#{ENV.fetch('APPRAISAL', nil)}" |
| 23 | + coverage_dir "coverage/#{ENV.fetch('RUBY_VERSION', nil)}-#{ENV.fetch('APPRAISAL', nil)}" |
| 24 | + end |
23 | 25 | end
|
0 commit comments