Class: Cucumber::Ast::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/ast/filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Filter

Returns a new instance of Filter.



4
5
6
# File 'lib/cucumber/ast/filter.rb', line 4

def initialize(options)
  @options = options
end

Instance Method Details

#matched?(node) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/cucumber/ast/filter.rb', line 8

def matched?(node)
  matched_by_tags?(node) &&
  matched_by_scenario_names?(node)
end

#matched_by_scenario_names?(node) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/cucumber/ast/filter.rb', line 17

def matched_by_scenario_names?(node)
  @options[:scenario_names].empty? || node.matches_scenario_names?(@options[:scenario_names])
end

#matched_by_tags?(node) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cucumber/ast/filter.rb', line 13

def matched_by_tags?(node)
  @options[:tags].empty? || node.tagged_with?(@options[:tags])
end