CoveredSourceCoveredOnly

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 output Covered::Base

The output to wrap.

parameter pattern Object

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 path String

The source path.

returns Boolean

Whether the path matches the pattern.

Implementation

def match?(path)
	@pattern === path
end