Class: Covered::Only
Overview
Only includes coverage for paths matching a pattern.
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Attributes inherited from Wrapper
Instance Method Summary collapse
-
#initialize(output, pattern) ⇒ Only
constructor
Initialize an only filter for the given pattern.
-
#match?(path) ⇒ Boolean
Whether the given path matches the only pattern.
- #The pattern matched with `===`.=(patternmatchedwith` = ==`.=(value)) ⇒ Object
Methods inherited from Filter
Methods inherited from Wrapper
#accept?, #add, #clear, #each, #expand_path, #finish, #mark, #relative_path, #start, #to_h
Methods inherited from Base
#accept?, #add, #clear, #each, #expand_path, #finish, #mark, #relative_path, #start
Constructor Details
#initialize(output, pattern) ⇒ Only
Initialize an only filter for the given pattern.
159 160 161 162 163 |
# File 'lib/covered/files.rb', line 159 def initialize(output, pattern) super(output) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
166 167 168 |
# File 'lib/covered/files.rb', line 166 def pattern @pattern end |
Instance Method Details
#match?(path) ⇒ Boolean
Whether the given path matches the only pattern.
171 172 173 |
# File 'lib/covered/files.rb', line 171 def match?(path) @pattern === path end |
#The pattern matched with `===`.=(patternmatchedwith` = ==`.=(value)) ⇒ Object
166 |
# File 'lib/covered/files.rb', line 166 attr :pattern |