Class: Cucumber::Ast::Visitor
Overview
Base class for formatters. This class just walks the tree depth first. Just override the methods you care about. Remember to call super if you override a method.
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#announce(announcement) ⇒ Object
-
#initialize(step_mother) ⇒ Visitor
constructor
A new instance of Visitor.
-
#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_array(examples_array) ⇒ 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) ⇒ 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_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) ⇒ Object
-
#visit_steps(steps) ⇒ Object
-
#visit_table_cell(table_cell) ⇒ Object
-
#visit_table_cell_value(value, 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.
10
11
12
13
|
# File 'lib/cucumber/ast/visitor.rb', line 10
def initialize(step_mother)
@options = {}
@step_mother = step_mother
end
|
Instance Attribute Details
7
8
9
|
# File 'lib/cucumber/ast/visitor.rb', line 7
def options
@options
end
|
#step_mother ⇒ Object
8
9
10
|
# File 'lib/cucumber/ast/visitor.rb', line 8
def step_mother
@step_mother
end
|
Instance Method Details
#announce(announcement) ⇒ Object
Print announcement
. This method can be called from within StepDefinitions.
110
111
|
# File 'lib/cucumber/ast/visitor.rb', line 110
def announce(announcement)
end
|
#visit_background(background) ⇒ Object
45
46
47
|
# File 'lib/cucumber/ast/visitor.rb', line 45
def visit_background(background)
background.accept(self)
end
|
#visit_background_name(keyword, name, file_colon_line, source_indent) ⇒ Object
49
50
|
# File 'lib/cucumber/ast/visitor.rb', line 49
def visit_background_name(keyword, name, file_colon_line, source_indent)
end
|
23
24
25
|
# File 'lib/cucumber/ast/visitor.rb', line 23
def ()
.accept(self)
end
|
27
28
|
# File 'lib/cucumber/ast/visitor.rb', line 27
def ()
end
|
#visit_examples(examples) ⇒ Object
56
57
58
|
# File 'lib/cucumber/ast/visitor.rb', line 56
def visit_examples(examples)
examples.accept(self)
end
|
#visit_examples_array(examples_array) ⇒ Object
52
53
54
|
# File 'lib/cucumber/ast/visitor.rb', line 52
def visit_examples_array(examples_array)
examples_array.accept(self)
end
|
#visit_examples_name(keyword, name) ⇒ Object
60
61
|
# File 'lib/cucumber/ast/visitor.rb', line 60
def visit_examples_name(keyword, name)
end
|
#visit_exception(exception, status) ⇒ Object
92
93
|
# File 'lib/cucumber/ast/visitor.rb', line 92
def visit_exception(exception, status) end
|
#visit_feature(feature) ⇒ Object
19
20
21
|
# File 'lib/cucumber/ast/visitor.rb', line 19
def visit_feature(feature)
feature.accept(self)
end
|
#visit_feature_element(feature_element) ⇒ Object
feature_element
is either Scenario or ScenarioOutline
41
42
43
|
# File 'lib/cucumber/ast/visitor.rb', line 41
def visit_feature_element(feature_element)
feature_element.accept(self)
end
|
#visit_feature_name(name) ⇒ Object
37
38
|
# File 'lib/cucumber/ast/visitor.rb', line 37
def visit_feature_name(name)
end
|
#visit_features(features) ⇒ Object
15
16
17
|
# File 'lib/cucumber/ast/visitor.rb', line 15
def visit_features(features)
features.accept(self)
end
|
#visit_multiline_arg(multiline_arg) ⇒ Object
88
89
90
|
# File 'lib/cucumber/ast/visitor.rb', line 88
def visit_multiline_arg(multiline_arg) multiline_arg.accept(self)
end
|
#visit_outline_table(outline_table) ⇒ Object
63
64
65
66
|
# File 'lib/cucumber/ast/visitor.rb', line 63
def visit_outline_table(outline_table)
@table = outline_table
outline_table.accept(self)
end
|
#visit_py_string(string) ⇒ Object
95
96
|
# File 'lib/cucumber/ast/visitor.rb', line 95
def visit_py_string(string)
end
|
#visit_scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object
68
69
|
# File 'lib/cucumber/ast/visitor.rb', line 68
def visit_scenario_name(keyword, name, file_colon_line, source_indent)
end
|
#visit_step(step) ⇒ Object
75
76
77
|
# File 'lib/cucumber/ast/visitor.rb', line 75
def visit_step(step)
step.accept(self)
end
|
#visit_step_name(keyword, step_match, status, source_indent, background) ⇒ Object
85
86
|
# File 'lib/cucumber/ast/visitor.rb', line 85
def visit_step_name(keyword, step_match, status, source_indent, background) end
|
#visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) ⇒ Object
79
80
81
82
83
|
# File 'lib/cucumber/ast/visitor.rb', line 79
def visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
visit_step_name(keyword, step_match, status, source_indent, background)
visit_multiline_arg(multiline_arg) if multiline_arg
visit_exception(exception, status) if exception
end
|
#visit_steps(steps) ⇒ Object
71
72
73
|
# File 'lib/cucumber/ast/visitor.rb', line 71
def visit_steps(steps)
steps.accept(self)
end
|
#visit_table_cell(table_cell) ⇒ Object
102
103
104
|
# File 'lib/cucumber/ast/visitor.rb', line 102
def visit_table_cell(table_cell)
table_cell.accept(self)
end
|
#visit_table_cell_value(value, status) ⇒ Object
106
107
|
# File 'lib/cucumber/ast/visitor.rb', line 106
def visit_table_cell_value(value, status)
end
|
#visit_table_row(table_row) ⇒ Object
98
99
100
|
# File 'lib/cucumber/ast/visitor.rb', line 98
def visit_table_row(table_row)
table_row.accept(self)
end
|
#visit_tag_name(tag_name) ⇒ Object
34
35
|
# File 'lib/cucumber/ast/visitor.rb', line 34
def visit_tag_name(tag_name)
end
|
30
31
32
|
# File 'lib/cucumber/ast/visitor.rb', line 30
def visit_tags(tags)
tags.accept(self)
end
|