Class: Cuporter::TagListParser

Inherits:
FeatureParser show all
Defined in:
lib/cuporter/tag_list_parser.rb

Constant Summary

Constants inherited from FeatureParser

FeatureParser::EXAMPLE_LINE, FeatureParser::EXAMPLE_SET_LINE, FeatureParser::FEATURE_LINE, FeatureParser::SCENARIO_LINE, FeatureParser::SCENARIO_OUTLINE_LINE, FeatureParser::SCENARIO_SET_LINE, FeatureParser::TAG_LINE

Instance Method Summary collapse

Methods inherited from FeatureParser

#initialize, name_list, #parse_feature, tag_list

Constructor Details

This class inherits a constructor from Cuporter::FeatureParser

Instance Method Details

#close_scenario_outlineObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/cuporter/tag_list_parser.rb', line 27

def close_scenario_outline
  if @scenario_outline
    if @example_set
      @scenario_outline.add_to_tag_nodes(@example_set) if @example_set
      @example_set = nil
    end
    @feature.merge_tag_nodes(@scenario_outline)
    @scenario_outline = nil
  end
end

#handle_example_set_lineObject



19
20
21
# File 'lib/cuporter/tag_list_parser.rb', line 19

def handle_example_set_line
  @scenario_outline.add_to_tag_nodes(@example_set)
end

#handle_scenario_line(sub_expression) ⇒ Object



11
12
13
# File 'lib/cuporter/tag_list_parser.rb', line 11

def handle_scenario_line(sub_expression)
  @feature.add_to_tag_nodes(TagListNode.new(sub_expression, @current_tags))
end

#new_example_set_node(sub_expression) ⇒ Object



23
24
25
# File 'lib/cuporter/tag_list_parser.rb', line 23

def new_example_set_node(sub_expression)
  ExampleSetNode.new(sub_expression, @feature.tags | @current_tags)
end

#new_feature_node(sub_expression) ⇒ Object

sub_expression is the paren group in the regex, dereferenced with $1 in the caller



7
8
9
# File 'lib/cuporter/tag_list_parser.rb', line 7

def new_feature_node(sub_expression)
  TagListNode.new(sub_expression, @current_tags)
end

#new_scenario_outline_node(sub_expression) ⇒ Object



15
16
17
# File 'lib/cuporter/tag_list_parser.rb', line 15

def new_scenario_outline_node(sub_expression)
  TagListNode.new(sub_expression, @current_tags)
end