class Only
Only includes coverage for paths matching a pattern.
Definitions
def initialize(output, pattern)
Initialize an only filter for the given pattern.
Signature
-
parameter
outputCovered::Base The output to wrap.
-
parameter
patternObject The pattern matched with
===.
Implementation
def initialize(output, pattern)
super(output)
@pattern = pattern
end
attr :pattern
Signature
-
attribute
Object The pattern matched with
===.
def match?(path)
Whether the given path matches the only pattern.
Signature
-
parameter
pathString The source path.
-
returns
Boolean Whether the path matches the pattern.
Implementation
def match?(path)
@pattern === path
end