Skip to content

Commit b8a863f

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 6862d6c commit b8a863f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/coverage_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
SimpleCov.start do
55
enable_coverage :branch
6-
add_filter "/test/"
6+
add_filter{|f| f.filename.start_with?(__dir__ + "/")}
77
add_group('Missing'){|src| src.covered_percent < 100}
88
add_group('Covered'){|src| src.covered_percent == 100}
99
end

0 commit comments

Comments
 (0)