Class: Cucumber::Ast::Visitor
Overview
A dumb visitor that implements the whole Visitor API and just walks the tree.
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#announce(announcement) ⇒ Object
-
#current_feature_lines=(lines) ⇒ Object
-
#excluded_by_tags?(node) ⇒ Boolean
-
#included_by_tags?(node) ⇒ Boolean
-
#initialize(step_mother) ⇒ Visitor
constructor
A new instance of Visitor.
-
#matches_lines?(node) ⇒ Boolean
-
#matches_scenario_names?(node) ⇒ Boolean
-
#visit_background(background) ⇒ Object
-
#visit_background_name(keyword, name, file_colon_line, source_indent) ⇒ Object
-
#visit_comment(comment) ⇒ Object
-
#visit_comment_line(comment_line) ⇒ Object
-
#visit_examples(examples) ⇒ Object
-
#visit_examples_name(keyword, name) ⇒ Object
-
#visit_exception(exception, status) ⇒ Object
-
#visit_feature(feature) ⇒ Object
-
#visit_feature_element(feature_element) ⇒ Object
feature_element
is either Scenario or ScenarioOutline.
-
#visit_feature_name(name) ⇒ Object
-
#visit_features(features) ⇒ Object
-
#visit_multiline_arg(multiline_arg) ⇒ Object
-
#visit_outline_table(outline_table) ⇒ Object
-
#visit_py_string(string, status) ⇒ Object
-
#visit_scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object
-
#visit_step(step) ⇒ Object
-
#visit_step_name(keyword, step_match, status, source_indent, background) ⇒ Object
-
#visit_steps(steps) ⇒ Object
-
#visit_table_cell(table_cell) ⇒ Object
-
#visit_table_cell_value(value, width, status) ⇒ Object
-
#visit_table_row(table_row) ⇒ Object
-
#visit_tag_name(tag_name) ⇒ Object
-
#visit_tags(tags) ⇒ Object
Constructor Details
#initialize(step_mother) ⇒ Visitor
Returns a new instance of Visitor.
8
9
10
11
12
|
# File 'lib/cucumber/ast/visitor.rb', line 8
def initialize(step_mother)
@options = {}
@step_mother = step_mother
@current_feature_lines = []
end
|
Instance Attribute Details
Returns the value of attribute options.
5
6
7
|
# File 'lib/cucumber/ast/visitor.rb', line 5
def options
@options
end
|
#step_mother ⇒ Object
Returns the value of attribute step_mother.
6
7
8
|
# File 'lib/cucumber/ast/visitor.rb', line 6
def step_mother
@step_mother
end
|
Instance Method Details
#announce(announcement) ⇒ Object
120
121
|
# File 'lib/cucumber/ast/visitor.rb', line 120
def announce(announcement)
end
|
#current_feature_lines=(lines) ⇒ Object
14
15
16
|
# File 'lib/cucumber/ast/visitor.rb', line 14
def current_feature_lines=(lines)
@current_feature_lines = lines
end
|
27
28
29
30
|
# File 'lib/cucumber/ast/visitor.rb', line 27
def excluded_by_tags?(node)
tags = options[:exclude_tags] || []
tags.any? && node.has_tags?(tags)
end
|
22
23
24
25
|
# File 'lib/cucumber/ast/visitor.rb', line 22
def included_by_tags?(node)
tags = options[:include_tags] || []
tags.empty? || node.has_tags?(tags)
end
|
#matches_lines?(node) ⇒ Boolean
18
19
20
|
# File 'lib/cucumber/ast/visitor.rb', line 18
def matches_lines?(node)
@current_feature_lines.empty? || node.matches_lines?(@current_feature_lines)
end
|
#matches_scenario_names?(node) ⇒ Boolean
32
33
34
35
|
# File 'lib/cucumber/ast/visitor.rb', line 32
def matches_scenario_names?(node)
scenario_names = options[:scenario_names] || []
scenario_names.empty? || node.matches_scenario_names?(scenario_names)
end
|
#visit_background(background) ⇒ Object
67
68
69
|
# File 'lib/cucumber/ast/visitor.rb', line 67
def visit_background(background)
background.accept(self)
end
|
#visit_background_name(keyword, name, file_colon_line, source_indent) ⇒ Object
71
72
|
# File 'lib/cucumber/ast/visitor.rb', line 71
def visit_background_name(keyword, name, file_colon_line, source_indent)
end
|
45
46
47
|
# File 'lib/cucumber/ast/visitor.rb', line 45
def ()
.accept(self)
end
|
49
50
|
# File 'lib/cucumber/ast/visitor.rb', line 49
def ()
end
|
#visit_examples(examples) ⇒ Object
74
75
76
|
# File 'lib/cucumber/ast/visitor.rb', line 74
def visit_examples(examples)
examples.accept(self)
end
|
#visit_examples_name(keyword, name) ⇒ Object
78
79
|
# File 'lib/cucumber/ast/visitor.rb', line 78
def visit_examples_name(keyword, name)
end
|
#visit_exception(exception, status) ⇒ Object
117
118
|
# File 'lib/cucumber/ast/visitor.rb', line 117
def visit_exception(exception, status)
end
|
#visit_feature(feature) ⇒ Object
41
42
43
|
# File 'lib/cucumber/ast/visitor.rb', line 41
def visit_feature(feature)
feature.accept(self)
end
|
#visit_feature_element(feature_element) ⇒ Object
feature_element
is either Scenario or ScenarioOutline
63
64
65
|
# File 'lib/cucumber/ast/visitor.rb', line 63
def visit_feature_element(feature_element)
feature_element.accept(self)
end
|
#visit_feature_name(name) ⇒ Object
59
60
|
# File 'lib/cucumber/ast/visitor.rb', line 59
def visit_feature_name(name)
end
|
#visit_features(features) ⇒ Object
37
38
39
|
# File 'lib/cucumber/ast/visitor.rb', line 37
def visit_features(features)
features.accept(self)
end
|
#visit_multiline_arg(multiline_arg) ⇒ Object
99
100
101
|
# File 'lib/cucumber/ast/visitor.rb', line 99
def visit_multiline_arg(multiline_arg)
multiline_arg.accept(self)
end
|
#visit_outline_table(outline_table) ⇒ Object
81
82
83
|
# File 'lib/cucumber/ast/visitor.rb', line 81
def visit_outline_table(outline_table)
outline_table.accept(self)
end
|
#visit_py_string(string, status) ⇒ Object
103
104
|
# File 'lib/cucumber/ast/visitor.rb', line 103
def visit_py_string(string, status)
end
|
#visit_scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object
85
86
|
# File 'lib/cucumber/ast/visitor.rb', line 85
def visit_scenario_name(keyword, name, file_colon_line, source_indent)
end
|
#visit_step(step) ⇒ Object
92
93
94
|
# File 'lib/cucumber/ast/visitor.rb', line 92
def visit_step(step)
step.accept(self)
end
|
#visit_step_name(keyword, step_match, status, source_indent, background) ⇒ Object
96
97
|
# File 'lib/cucumber/ast/visitor.rb', line 96
def visit_step_name(keyword, step_match, status, source_indent, background)
end
|
#visit_steps(steps) ⇒ Object
88
89
90
|
# File 'lib/cucumber/ast/visitor.rb', line 88
def visit_steps(steps)
steps.accept(self)
end
|
#visit_table_cell(table_cell) ⇒ Object
110
111
112
|
# File 'lib/cucumber/ast/visitor.rb', line 110
def visit_table_cell(table_cell)
table_cell.accept(self)
end
|
#visit_table_cell_value(value, width, status) ⇒ Object
114
115
|
# File 'lib/cucumber/ast/visitor.rb', line 114
def visit_table_cell_value(value, width, status)
end
|
#visit_table_row(table_row) ⇒ Object
106
107
108
|
# File 'lib/cucumber/ast/visitor.rb', line 106
def visit_table_row(table_row)
table_row.accept(self)
end
|
#visit_tag_name(tag_name) ⇒ Object
56
57
|
# File 'lib/cucumber/ast/visitor.rb', line 56
def visit_tag_name(tag_name)
end
|
52
53
54
|
# File 'lib/cucumber/ast/visitor.rb', line 52
def visit_tags(tags)
tags.accept(self)
end
|