123456789_123456789_123456789_123456789_123456789_

Class: SimpleCov::RegexFilter

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Filter
Instance Chain:
self, Filter
Inherits: SimpleCov::Filter
Defined in: lib/simplecov/filter.rb

Overview

Filter that matches when the source file's project path matches the configured Regexp.

Class Method Summary

Instance Attribute Summary

Filter - Inherited

Instance Method Summary

Filter - Inherited

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.

[ GitHub ]

  
# File 'lib/simplecov/filter.rb', line 95

def matches?(source_file)
  filter_argument.match?(source_file.project_filename)
end