Class: ChefSpec::Coverage::RegexpFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/chefspec/coverage/filters.rb

Overview

Examples:

Match resources based on a regular expression.

add_filter /^test/

Direct Known Subclasses

StringFilter

Instance Method Summary collapse

Methods inherited from Filter

#initialize

Constructor Details

This class inherits a constructor from ChefSpec::Coverage::Filter

Instance Method Details

#matches?(resource) ⇒ Boolean

Returns:

  • (Boolean)

18
19
20
21
# File 'lib/chefspec/coverage/filters.rb', line 18

def matches?(resource)
  return true if resource.source_line.nil?
  @filter =~ resource.source_line
end