Skip to content

Commit 780d4ea

Browse files
committed
Use SimpleCov.add_filter block instead of string
Using a string is almost always a bad idea, because if any part of the path contains the string, it will filter out the path. Switch to using a block and doing a match on the entire path prefix.
1 parent 4e379f8 commit 780d4ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'simplecov'
33
SimpleCov.start do
44
enable_coverage :branch
5-
add_filter "/spec/"
5+
add_filter{|f| f.filename.match(%r{\A#{Regexp.escape(__dir__)}/})}
66
add_group('Missing'){|src| src.covered_percent < 100}
77
add_group('Covered'){|src| src.covered_percent == 100}
88
end

0 commit comments

Comments
 (0)