File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ def start_coverage_measurement
342
342
if coverage_start_arguments_supported?
343
343
start_coverage_with_criteria
344
344
else
345
- Coverage . start unless Coverage . running ?
345
+ Coverage . start unless coverage_running ?
346
346
end
347
347
end
348
348
@@ -353,7 +353,13 @@ def start_coverage_with_criteria
353
353
354
354
start_arguments [ :eval ] = true if coverage_for_eval_enabled?
355
355
356
- Coverage . start ( start_arguments ) unless Coverage . running?
356
+ Coverage . start ( start_arguments ) unless coverage_running?
357
+ end
358
+
359
+ def coverage_running?
360
+ # for ruby versions which do not implement Coverage.running?,
361
+ # Coverage.start may be called multiple times without raising.
362
+ Coverage . respond_to? ( :running? ) && Coverage . running?
357
363
end
358
364
359
365
CRITERION_TO_RUBY_COVERAGE = {
You can’t perform that action at this time.
0 commit comments