Class: SimpleCov::RegexFilter
- Defined in:
- lib/simplecov/filter.rb,
sig/simplecov.rbs
Overview
Matches when the project path matches the configured Regexp.
Instance Attribute Summary
Attributes inherited from Filter
Instance Method Summary collapse
-
#matches?(source_file) ⇒ Boolean
Returns true when the given source file's filename matches the regex configured when initializing this Filter with RegexFilter.new(/someregex/).
-
#path_only? ⇒ Boolean
Whether the verdict depends only on the path, so it can be decided before the file has any coverage.
Methods inherited from Filter
build_filter, class_for_argument, #initialize
Constructor Details
This class inherits a constructor from SimpleCov::Filter
Instance Method Details
#matches?(source_file) ⇒ Boolean
Returns true when the given source file's filename matches the
regex configured when initializing this Filter with RegexFilter.new(/someregex/).
Uses Regexp#match? so the predicate returns a real boolean — =~
would return the match position (an Integer or nil), which trips
rspec-mocks 4's stricter predicate-matcher type check.
116 117 118 |
# File 'lib/simplecov/filter.rb', line 116 def matches?(source_file) filter_argument.match?(source_file.project_filename) end |
#path_only? ⇒ Boolean
Whether the verdict depends only on the path, so it can be decided before the file has any coverage.
1265 1266 1267 |
# File 'sig/simplecov.rbs', line 1265 def path_only? true end |