Skip to content

Commit 62299a4

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 3d4496c commit 62299a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/sequel_postgresql_triggers_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
SimpleCov.start do
88
enable_coverage :branch
99
command_name coverage
10-
add_filter "/spec/"
10+
add_filter{|f| f.filename.match(%r{\A#{Regexp.escape(File.expand_path(File.dirname(__FILE__)))}/})}
1111
add_group('Missing'){|src| src.covered_percent < 100}
1212
add_group('Covered'){|src| src.covered_percent == 100}
1313
end

0 commit comments

Comments
 (0)