Skip to content

Commit ab55205

Browse files
committed
Simplecov isn't smart about ruby 3.1 parallel tests
1 parent dd51d04 commit ab55205

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

spec/spec_helper.rb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
require 'simplecov'
33
require 'simplecov-rcov'
44
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
5-
SimpleCov.start do
6-
add_filter '/vendor'
7-
add_filter '/spec'
8-
add_filter '/test'
5+
unless SimpleCov.running
6+
SimpleCov.start do
7+
add_filter '/vendor'
8+
add_filter '/spec'
9+
add_filter '/test'
10+
end
911
end
1012
end
1113

@@ -21,13 +23,6 @@
2123

2224
require 'spark_api'
2325

24-
if ENV['COVERAGE'] == "on"
25-
require 'simplecov'
26-
require 'simplecov-rcov'
27-
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
28-
SimpleCov.start { add_filter %w(/vendor /spec /test) }
29-
end
30-
3126
FileUtils.mkdir 'log' unless File.exists? 'log'
3227

3328
module SparkApi
@@ -51,7 +46,7 @@ def reset_config
5146

5247
# Requires supporting ruby files with custom matchers and macros, etc,
5348
# # in spec/support/ and its subdirectories.
54-
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
49+
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each { |f| require f }
5550

5651
RSpec.configure do |config|
5752

@@ -66,6 +61,6 @@ def reset_config
6661
config.color = true
6762
end
6863

69-
def jruby?
64+
def jruby?
7065
RUBY_PLATFORM == "java"
7166
end

0 commit comments

Comments
 (0)