cuke_modeler 3.27.0 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +579 -572
- data/LICENSE.txt +22 -22
- data/README.md +135 -135
- data/cuke_modeler.gemspec +59 -59
- data/lib/cuke_modeler/adapters/gherkin_10_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_11_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_12_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_13_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_14_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_15_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_16_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_17_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_18_adapter.rb +27 -27
- data/lib/cuke_modeler/adapters/gherkin_19_adapter.rb +64 -64
- data/lib/cuke_modeler/adapters/gherkin_20_adapter.rb +359 -359
- data/lib/cuke_modeler/adapters/gherkin_21_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_22_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_23_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_24_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_25_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_26_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_27_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_28_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_29_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_30_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_31_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_32_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_33_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_34_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_35_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_36_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_37_adapter.rb +13 -13
- data/lib/cuke_modeler/adapters/gherkin_38_adapter.rb +13 -0
- data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +375 -375
- data/lib/cuke_modeler/adapters/gherkin_base_adapter.rb +17 -17
- data/lib/cuke_modeler/containing.rb +105 -105
- data/lib/cuke_modeler/described.rb +71 -71
- data/lib/cuke_modeler/models/background.rb +122 -122
- data/lib/cuke_modeler/models/cell.rb +88 -88
- data/lib/cuke_modeler/models/comment.rb +82 -82
- data/lib/cuke_modeler/models/directory.rb +143 -143
- data/lib/cuke_modeler/models/doc_string.rb +104 -104
- data/lib/cuke_modeler/models/example.rb +274 -274
- data/lib/cuke_modeler/models/feature.rb +200 -200
- data/lib/cuke_modeler/models/feature_file.rb +116 -116
- data/lib/cuke_modeler/models/model.rb +87 -87
- data/lib/cuke_modeler/models/outline.rb +145 -145
- data/lib/cuke_modeler/models/row.rb +104 -104
- data/lib/cuke_modeler/models/rule.rb +162 -162
- data/lib/cuke_modeler/models/scenario.rb +128 -128
- data/lib/cuke_modeler/models/step.rb +178 -178
- data/lib/cuke_modeler/models/table.rb +117 -117
- data/lib/cuke_modeler/models/tag.rb +75 -75
- data/lib/cuke_modeler/named.rb +26 -26
- data/lib/cuke_modeler/nested.rb +61 -61
- data/lib/cuke_modeler/parsed.rb +24 -24
- data/lib/cuke_modeler/parsing.rb +208 -208
- data/lib/cuke_modeler/sourceable.rb +29 -29
- data/lib/cuke_modeler/stepped.rb +34 -34
- data/lib/cuke_modeler/taggable.rb +57 -57
- data/lib/cuke_modeler/version.rb +4 -4
- data/lib/cuke_modeler.rb +32 -32
- data/testing/cucumber/features/analysis/step_comparison.feature +25 -25
- data/testing/cucumber/features/analysis/test_comparison.feature +35 -35
- data/testing/cucumber/features/modeling/background_modeling.feature +105 -105
- data/testing/cucumber/features/modeling/background_output.feature +60 -60
- data/testing/cucumber/features/modeling/cell_modeling.feature +68 -68
- data/testing/cucumber/features/modeling/cell_output.feature +36 -36
- data/testing/cucumber/features/modeling/comment_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/comment_output.feature +40 -40
- data/testing/cucumber/features/modeling/directory_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/directory_output.feature +33 -33
- data/testing/cucumber/features/modeling/doc_string_modeling.feature +85 -85
- data/testing/cucumber/features/modeling/doc_string_output.feature +50 -50
- data/testing/cucumber/features/modeling/example_modeling.feature +155 -155
- data/testing/cucumber/features/modeling/example_output.feature +57 -57
- data/testing/cucumber/features/modeling/feature_file_modeling.feature +49 -49
- data/testing/cucumber/features/modeling/feature_file_output.feature +33 -33
- data/testing/cucumber/features/modeling/feature_modeling.feature +149 -149
- data/testing/cucumber/features/modeling/feature_output.feature +144 -144
- data/testing/cucumber/features/modeling/model_output.feature +61 -61
- data/testing/cucumber/features/modeling/model_structure.feature +42 -42
- data/testing/cucumber/features/modeling/outline_modeling.feature +175 -175
- data/testing/cucumber/features/modeling/outline_output.feature +87 -87
- data/testing/cucumber/features/modeling/row_modeling.feature +70 -70
- data/testing/cucumber/features/modeling/row_output.feature +40 -40
- data/testing/cucumber/features/modeling/rule_modeling.feature +171 -171
- data/testing/cucumber/features/modeling/rule_output.feature +136 -136
- data/testing/cucumber/features/modeling/scenario_modeling.feature +146 -146
- data/testing/cucumber/features/modeling/scenario_output.feature +63 -63
- data/testing/cucumber/features/modeling/step_modeling.feature +105 -105
- data/testing/cucumber/features/modeling/step_output.feature +47 -47
- data/testing/cucumber/features/modeling/table_modeling.feature +73 -73
- data/testing/cucumber/features/modeling/table_output.feature +42 -42
- data/testing/cucumber/features/modeling/tag_modeling.feature +62 -62
- data/testing/cucumber/features/modeling/tag_output.feature +40 -40
- metadata +6 -8
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
Feature: Doc string output
|
|
2
|
-
|
|
3
|
-
A doc string model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
-
inspection is the content of the doc string that it models.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Background:
|
|
8
|
-
Given the following gherkin:
|
|
9
|
-
"""
|
|
10
|
-
\"\"\" type foo
|
|
11
|
-
Some text
|
|
12
|
-
|
|
13
|
-
some more text
|
|
14
|
-
|
|
15
|
-
\"\"\"
|
|
16
|
-
"""
|
|
17
|
-
And a doc string model based on that gherkin
|
|
18
|
-
"""
|
|
19
|
-
@model = CukeModeler::DocString.new(<source_text>)
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Scenario: Stringify a doc string model
|
|
24
|
-
When the model is output as a string
|
|
25
|
-
"""
|
|
26
|
-
@model.to_s
|
|
27
|
-
"""
|
|
28
|
-
Then the following text is provided:
|
|
29
|
-
"""
|
|
30
|
-
\"\"\" type foo
|
|
31
|
-
Some text
|
|
32
|
-
|
|
33
|
-
some more text
|
|
34
|
-
|
|
35
|
-
\"\"\"
|
|
36
|
-
"""
|
|
37
|
-
And the output can be used to make an equivalent model
|
|
38
|
-
"""
|
|
39
|
-
CukeModeler::DocString.new(@model.to_s)
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
Scenario: Inspect a doc string model
|
|
43
|
-
When the model is inspected
|
|
44
|
-
"""
|
|
45
|
-
@model.inspect
|
|
46
|
-
"""
|
|
47
|
-
Then the following text is provided:
|
|
48
|
-
"""
|
|
49
|
-
#<CukeModeler::DocString:<object_id> @content: "Some text\n\n some more text\n">
|
|
50
|
-
"""
|
|
1
|
+
Feature: Doc string output
|
|
2
|
+
|
|
3
|
+
A doc string model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
+
inspection is the content of the doc string that it models.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the following gherkin:
|
|
9
|
+
"""
|
|
10
|
+
\"\"\" type foo
|
|
11
|
+
Some text
|
|
12
|
+
|
|
13
|
+
some more text
|
|
14
|
+
|
|
15
|
+
\"\"\"
|
|
16
|
+
"""
|
|
17
|
+
And a doc string model based on that gherkin
|
|
18
|
+
"""
|
|
19
|
+
@model = CukeModeler::DocString.new(<source_text>)
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Scenario: Stringify a doc string model
|
|
24
|
+
When the model is output as a string
|
|
25
|
+
"""
|
|
26
|
+
@model.to_s
|
|
27
|
+
"""
|
|
28
|
+
Then the following text is provided:
|
|
29
|
+
"""
|
|
30
|
+
\"\"\" type foo
|
|
31
|
+
Some text
|
|
32
|
+
|
|
33
|
+
some more text
|
|
34
|
+
|
|
35
|
+
\"\"\"
|
|
36
|
+
"""
|
|
37
|
+
And the output can be used to make an equivalent model
|
|
38
|
+
"""
|
|
39
|
+
CukeModeler::DocString.new(@model.to_s)
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
Scenario: Inspect a doc string model
|
|
43
|
+
When the model is inspected
|
|
44
|
+
"""
|
|
45
|
+
@model.inspect
|
|
46
|
+
"""
|
|
47
|
+
Then the following text is provided:
|
|
48
|
+
"""
|
|
49
|
+
#<CukeModeler::DocString:<object_id> @content: "Some text\n\n some more text\n">
|
|
50
|
+
"""
|
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
Feature: Example modeling
|
|
2
|
-
|
|
3
|
-
Example models represent an example table of a Scenario Outline portion of a feature. They expose several attributes of the example that they represent, as well as containing models for the example rows and tags that are present in that example.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Background:
|
|
7
|
-
Given the following gherkin:
|
|
8
|
-
"""
|
|
9
|
-
@a_tag
|
|
10
|
-
Examples: test example
|
|
11
|
-
|
|
12
|
-
Some example description.
|
|
13
|
-
|
|
14
|
-
Some more.
|
|
15
|
-
Even more.
|
|
16
|
-
|
|
17
|
-
| param 1 | param 2 |
|
|
18
|
-
| value 1 | value 2 |
|
|
19
|
-
"""
|
|
20
|
-
And an example model based on that gherkin
|
|
21
|
-
"""
|
|
22
|
-
@model = CukeModeler::Example.new(<source_text>)
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Scenario: Modeling an example's keyword
|
|
27
|
-
When the example's keyword is requested
|
|
28
|
-
"""
|
|
29
|
-
@model.keyword
|
|
30
|
-
"""
|
|
31
|
-
Then the model returns "Examples"
|
|
32
|
-
|
|
33
|
-
Scenario: Modeling an example's name
|
|
34
|
-
When the example's name is requested
|
|
35
|
-
"""
|
|
36
|
-
@model.name
|
|
37
|
-
"""
|
|
38
|
-
Then the model returns "test example"
|
|
39
|
-
|
|
40
|
-
Scenario: Modeling an example's description
|
|
41
|
-
When the example's description is requested
|
|
42
|
-
"""
|
|
43
|
-
@model.description
|
|
44
|
-
"""
|
|
45
|
-
Then the model returns
|
|
46
|
-
"""
|
|
47
|
-
Some example description.
|
|
48
|
-
|
|
49
|
-
Some more.
|
|
50
|
-
Even more.
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
Scenario: Modeling an example's rows
|
|
54
|
-
When the example's rows are requested
|
|
55
|
-
"""
|
|
56
|
-
@model.rows
|
|
57
|
-
"""
|
|
58
|
-
Then the model returns models for the following rows:
|
|
59
|
-
| param 1 | param 2 |
|
|
60
|
-
| value 1 | value 2 |
|
|
61
|
-
|
|
62
|
-
Scenario: Modeling an example's tags
|
|
63
|
-
Given the following gherkin:
|
|
64
|
-
"""
|
|
65
|
-
@feature_tag
|
|
66
|
-
Feature:
|
|
67
|
-
|
|
68
|
-
@outline_tag
|
|
69
|
-
Scenario Outline:
|
|
70
|
-
* a step
|
|
71
|
-
|
|
72
|
-
@example_tag
|
|
73
|
-
Examples:
|
|
74
|
-
| param |
|
|
75
|
-
| value |
|
|
76
|
-
"""
|
|
77
|
-
And a feature model based on that gherkin
|
|
78
|
-
"""
|
|
79
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
80
|
-
"""
|
|
81
|
-
And the example model inside of that feature model
|
|
82
|
-
"""
|
|
83
|
-
@model = @model.tests.first.examples.first
|
|
84
|
-
"""
|
|
85
|
-
When the example's tags are requested
|
|
86
|
-
"""
|
|
87
|
-
@model.tags
|
|
88
|
-
"""
|
|
89
|
-
Then the model returns models for the following tags:
|
|
90
|
-
| @example_tag |
|
|
91
|
-
When the example's inherited tags are requested
|
|
92
|
-
"""
|
|
93
|
-
@model.applied_tags
|
|
94
|
-
"""
|
|
95
|
-
Then the model returns models for the following tags:
|
|
96
|
-
| @feature_tag |
|
|
97
|
-
| @outline_tag |
|
|
98
|
-
When all of the example's tags are requested
|
|
99
|
-
"""
|
|
100
|
-
@model.all_tags
|
|
101
|
-
"""
|
|
102
|
-
Then the model returns models for the following tags:
|
|
103
|
-
| @feature_tag |
|
|
104
|
-
| @outline_tag |
|
|
105
|
-
| @example_tag |
|
|
106
|
-
|
|
107
|
-
Scenario: Modeling an example's source line
|
|
108
|
-
Given the following gherkin:
|
|
109
|
-
"""
|
|
110
|
-
Feature:
|
|
111
|
-
|
|
112
|
-
Scenario Outline:
|
|
113
|
-
* a step
|
|
114
|
-
Examples:
|
|
115
|
-
| param |
|
|
116
|
-
| value |
|
|
117
|
-
"""
|
|
118
|
-
And a feature model based on that gherkin
|
|
119
|
-
"""
|
|
120
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
121
|
-
"""
|
|
122
|
-
And the example model inside of that feature model
|
|
123
|
-
"""
|
|
124
|
-
@model = @model.tests.first.examples.first
|
|
125
|
-
"""
|
|
126
|
-
When the example's source line is requested
|
|
127
|
-
"""
|
|
128
|
-
@model.source_line
|
|
129
|
-
"""
|
|
130
|
-
Then the model returns "5"
|
|
131
|
-
|
|
132
|
-
Scenario: Modeling an example's source column
|
|
133
|
-
Given the following gherkin:
|
|
134
|
-
"""
|
|
135
|
-
Feature:
|
|
136
|
-
|
|
137
|
-
Scenario Outline:
|
|
138
|
-
* a step
|
|
139
|
-
Examples:
|
|
140
|
-
| param |
|
|
141
|
-
| value |
|
|
142
|
-
"""
|
|
143
|
-
And a feature model based on that gherkin
|
|
144
|
-
"""
|
|
145
|
-
@model = CukeModeler::Feature.new(<source_text>)
|
|
146
|
-
"""
|
|
147
|
-
And the example model inside of that feature model
|
|
148
|
-
"""
|
|
149
|
-
@model = @model.tests.first.examples.first
|
|
150
|
-
"""
|
|
151
|
-
When the example's source column is requested
|
|
152
|
-
"""
|
|
153
|
-
@model.source_column
|
|
154
|
-
"""
|
|
155
|
-
Then the model returns "3"
|
|
1
|
+
Feature: Example modeling
|
|
2
|
+
|
|
3
|
+
Example models represent an example table of a Scenario Outline portion of a feature. They expose several attributes of the example that they represent, as well as containing models for the example rows and tags that are present in that example.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given the following gherkin:
|
|
8
|
+
"""
|
|
9
|
+
@a_tag
|
|
10
|
+
Examples: test example
|
|
11
|
+
|
|
12
|
+
Some example description.
|
|
13
|
+
|
|
14
|
+
Some more.
|
|
15
|
+
Even more.
|
|
16
|
+
|
|
17
|
+
| param 1 | param 2 |
|
|
18
|
+
| value 1 | value 2 |
|
|
19
|
+
"""
|
|
20
|
+
And an example model based on that gherkin
|
|
21
|
+
"""
|
|
22
|
+
@model = CukeModeler::Example.new(<source_text>)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Scenario: Modeling an example's keyword
|
|
27
|
+
When the example's keyword is requested
|
|
28
|
+
"""
|
|
29
|
+
@model.keyword
|
|
30
|
+
"""
|
|
31
|
+
Then the model returns "Examples"
|
|
32
|
+
|
|
33
|
+
Scenario: Modeling an example's name
|
|
34
|
+
When the example's name is requested
|
|
35
|
+
"""
|
|
36
|
+
@model.name
|
|
37
|
+
"""
|
|
38
|
+
Then the model returns "test example"
|
|
39
|
+
|
|
40
|
+
Scenario: Modeling an example's description
|
|
41
|
+
When the example's description is requested
|
|
42
|
+
"""
|
|
43
|
+
@model.description
|
|
44
|
+
"""
|
|
45
|
+
Then the model returns
|
|
46
|
+
"""
|
|
47
|
+
Some example description.
|
|
48
|
+
|
|
49
|
+
Some more.
|
|
50
|
+
Even more.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
Scenario: Modeling an example's rows
|
|
54
|
+
When the example's rows are requested
|
|
55
|
+
"""
|
|
56
|
+
@model.rows
|
|
57
|
+
"""
|
|
58
|
+
Then the model returns models for the following rows:
|
|
59
|
+
| param 1 | param 2 |
|
|
60
|
+
| value 1 | value 2 |
|
|
61
|
+
|
|
62
|
+
Scenario: Modeling an example's tags
|
|
63
|
+
Given the following gherkin:
|
|
64
|
+
"""
|
|
65
|
+
@feature_tag
|
|
66
|
+
Feature:
|
|
67
|
+
|
|
68
|
+
@outline_tag
|
|
69
|
+
Scenario Outline:
|
|
70
|
+
* a step
|
|
71
|
+
|
|
72
|
+
@example_tag
|
|
73
|
+
Examples:
|
|
74
|
+
| param |
|
|
75
|
+
| value |
|
|
76
|
+
"""
|
|
77
|
+
And a feature model based on that gherkin
|
|
78
|
+
"""
|
|
79
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
80
|
+
"""
|
|
81
|
+
And the example model inside of that feature model
|
|
82
|
+
"""
|
|
83
|
+
@model = @model.tests.first.examples.first
|
|
84
|
+
"""
|
|
85
|
+
When the example's tags are requested
|
|
86
|
+
"""
|
|
87
|
+
@model.tags
|
|
88
|
+
"""
|
|
89
|
+
Then the model returns models for the following tags:
|
|
90
|
+
| @example_tag |
|
|
91
|
+
When the example's inherited tags are requested
|
|
92
|
+
"""
|
|
93
|
+
@model.applied_tags
|
|
94
|
+
"""
|
|
95
|
+
Then the model returns models for the following tags:
|
|
96
|
+
| @feature_tag |
|
|
97
|
+
| @outline_tag |
|
|
98
|
+
When all of the example's tags are requested
|
|
99
|
+
"""
|
|
100
|
+
@model.all_tags
|
|
101
|
+
"""
|
|
102
|
+
Then the model returns models for the following tags:
|
|
103
|
+
| @feature_tag |
|
|
104
|
+
| @outline_tag |
|
|
105
|
+
| @example_tag |
|
|
106
|
+
|
|
107
|
+
Scenario: Modeling an example's source line
|
|
108
|
+
Given the following gherkin:
|
|
109
|
+
"""
|
|
110
|
+
Feature:
|
|
111
|
+
|
|
112
|
+
Scenario Outline:
|
|
113
|
+
* a step
|
|
114
|
+
Examples:
|
|
115
|
+
| param |
|
|
116
|
+
| value |
|
|
117
|
+
"""
|
|
118
|
+
And a feature model based on that gherkin
|
|
119
|
+
"""
|
|
120
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
121
|
+
"""
|
|
122
|
+
And the example model inside of that feature model
|
|
123
|
+
"""
|
|
124
|
+
@model = @model.tests.first.examples.first
|
|
125
|
+
"""
|
|
126
|
+
When the example's source line is requested
|
|
127
|
+
"""
|
|
128
|
+
@model.source_line
|
|
129
|
+
"""
|
|
130
|
+
Then the model returns "5"
|
|
131
|
+
|
|
132
|
+
Scenario: Modeling an example's source column
|
|
133
|
+
Given the following gherkin:
|
|
134
|
+
"""
|
|
135
|
+
Feature:
|
|
136
|
+
|
|
137
|
+
Scenario Outline:
|
|
138
|
+
* a step
|
|
139
|
+
Examples:
|
|
140
|
+
| param |
|
|
141
|
+
| value |
|
|
142
|
+
"""
|
|
143
|
+
And a feature model based on that gherkin
|
|
144
|
+
"""
|
|
145
|
+
@model = CukeModeler::Feature.new(<source_text>)
|
|
146
|
+
"""
|
|
147
|
+
And the example model inside of that feature model
|
|
148
|
+
"""
|
|
149
|
+
@model = @model.tests.first.examples.first
|
|
150
|
+
"""
|
|
151
|
+
When the example's source column is requested
|
|
152
|
+
"""
|
|
153
|
+
@model.source_column
|
|
154
|
+
"""
|
|
155
|
+
Then the model returns "3"
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
Feature: Example output
|
|
2
|
-
|
|
3
|
-
An example model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
-
inspection is the name of the example that it models.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Background:
|
|
8
|
-
Given the following gherkin:
|
|
9
|
-
"""
|
|
10
|
-
@tag1
|
|
11
|
-
@tag2 @tag3
|
|
12
|
-
Examples: An example with everything that it could have
|
|
13
|
-
|
|
14
|
-
Some description.
|
|
15
|
-
Some more description.
|
|
16
|
-
|
|
17
|
-
|param1|param2|
|
|
18
|
-
|value1|value2|
|
|
19
|
-
|value3|value4|
|
|
20
|
-
"""
|
|
21
|
-
And an example model based on that gherkin
|
|
22
|
-
"""
|
|
23
|
-
@model = CukeModeler::Example.new(<source_text>)
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Scenario: Stringify an example model
|
|
28
|
-
When the model is output as a string
|
|
29
|
-
"""
|
|
30
|
-
@model.to_s
|
|
31
|
-
"""
|
|
32
|
-
Then the following text is provided:
|
|
33
|
-
"""
|
|
34
|
-
@tag1 @tag2 @tag3
|
|
35
|
-
Examples: An example with everything that it could have
|
|
36
|
-
|
|
37
|
-
Some description.
|
|
38
|
-
Some more description.
|
|
39
|
-
|
|
40
|
-
| param1 | param2 |
|
|
41
|
-
| value1 | value2 |
|
|
42
|
-
| value3 | value4 |
|
|
43
|
-
"""
|
|
44
|
-
And the output can be used to make an equivalent model
|
|
45
|
-
"""
|
|
46
|
-
CukeModeler::Example.new(@model.to_s)
|
|
47
|
-
"""
|
|
48
|
-
|
|
49
|
-
Scenario: Inspect an example model
|
|
50
|
-
When the model is inspected
|
|
51
|
-
"""
|
|
52
|
-
@model.inspect
|
|
53
|
-
"""
|
|
54
|
-
Then the following text is provided:
|
|
55
|
-
"""
|
|
56
|
-
#<CukeModeler::Example:<object_id> @name: "An example with everything that it could have">
|
|
57
|
-
"""
|
|
1
|
+
Feature: Example output
|
|
2
|
+
|
|
3
|
+
An example model's string output is a Gherkin representation of itself and its most relevant attribute for
|
|
4
|
+
inspection is the name of the example that it models.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the following gherkin:
|
|
9
|
+
"""
|
|
10
|
+
@tag1
|
|
11
|
+
@tag2 @tag3
|
|
12
|
+
Examples: An example with everything that it could have
|
|
13
|
+
|
|
14
|
+
Some description.
|
|
15
|
+
Some more description.
|
|
16
|
+
|
|
17
|
+
|param1|param2|
|
|
18
|
+
|value1|value2|
|
|
19
|
+
|value3|value4|
|
|
20
|
+
"""
|
|
21
|
+
And an example model based on that gherkin
|
|
22
|
+
"""
|
|
23
|
+
@model = CukeModeler::Example.new(<source_text>)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Scenario: Stringify an example model
|
|
28
|
+
When the model is output as a string
|
|
29
|
+
"""
|
|
30
|
+
@model.to_s
|
|
31
|
+
"""
|
|
32
|
+
Then the following text is provided:
|
|
33
|
+
"""
|
|
34
|
+
@tag1 @tag2 @tag3
|
|
35
|
+
Examples: An example with everything that it could have
|
|
36
|
+
|
|
37
|
+
Some description.
|
|
38
|
+
Some more description.
|
|
39
|
+
|
|
40
|
+
| param1 | param2 |
|
|
41
|
+
| value1 | value2 |
|
|
42
|
+
| value3 | value4 |
|
|
43
|
+
"""
|
|
44
|
+
And the output can be used to make an equivalent model
|
|
45
|
+
"""
|
|
46
|
+
CukeModeler::Example.new(@model.to_s)
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
Scenario: Inspect an example model
|
|
50
|
+
When the model is inspected
|
|
51
|
+
"""
|
|
52
|
+
@model.inspect
|
|
53
|
+
"""
|
|
54
|
+
Then the following text is provided:
|
|
55
|
+
"""
|
|
56
|
+
#<CukeModeler::Example:<object_id> @name: "An example with everything that it could have">
|
|
57
|
+
"""
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
Feature: Feature file modeling
|
|
2
|
-
|
|
3
|
-
Feature file models represent a single .feature file in a test suite. They expose several attributes of the feature file that they represent, as well as containing the model for the feature that is present in that file.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Background: An existing feature file
|
|
7
|
-
Given the directory "test_directory"
|
|
8
|
-
And the file "test_directory/foo.feature":
|
|
9
|
-
"""
|
|
10
|
-
# A comment
|
|
11
|
-
# Another comment
|
|
12
|
-
Feature: Bar
|
|
13
|
-
"""
|
|
14
|
-
And the feature file is modeled
|
|
15
|
-
"""
|
|
16
|
-
@model = CukeModeler::FeatureFile.new('<path_to>/test_directory/foo.feature')
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Scenario: Modeling a feature files's path
|
|
21
|
-
When the feature file's path is requested
|
|
22
|
-
"""
|
|
23
|
-
@model.path
|
|
24
|
-
"""
|
|
25
|
-
Then the model returns "path_to/test_directory/foo.feature"
|
|
26
|
-
|
|
27
|
-
Scenario: Modeling a feature files's name
|
|
28
|
-
When the feature file's name is requested
|
|
29
|
-
"""
|
|
30
|
-
@model.name
|
|
31
|
-
"""
|
|
32
|
-
Then the model returns "foo.feature"
|
|
33
|
-
|
|
34
|
-
Scenario: Modeling a feature file's comments
|
|
35
|
-
When the feature file's comments are requested
|
|
36
|
-
"""
|
|
37
|
-
@model.comments
|
|
38
|
-
"""
|
|
39
|
-
Then the model returns models for the following comments:
|
|
40
|
-
| # A comment |
|
|
41
|
-
| # Another comment |
|
|
42
|
-
|
|
43
|
-
Scenario: Modeling a feature file's feature
|
|
44
|
-
When the feature file's feature is requested
|
|
45
|
-
"""
|
|
46
|
-
@model.feature
|
|
47
|
-
"""
|
|
48
|
-
Then the model returns a model for the following feature:
|
|
49
|
-
| Bar |
|
|
1
|
+
Feature: Feature file modeling
|
|
2
|
+
|
|
3
|
+
Feature file models represent a single .feature file in a test suite. They expose several attributes of the feature file that they represent, as well as containing the model for the feature that is present in that file.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Background: An existing feature file
|
|
7
|
+
Given the directory "test_directory"
|
|
8
|
+
And the file "test_directory/foo.feature":
|
|
9
|
+
"""
|
|
10
|
+
# A comment
|
|
11
|
+
# Another comment
|
|
12
|
+
Feature: Bar
|
|
13
|
+
"""
|
|
14
|
+
And the feature file is modeled
|
|
15
|
+
"""
|
|
16
|
+
@model = CukeModeler::FeatureFile.new('<path_to>/test_directory/foo.feature')
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Scenario: Modeling a feature files's path
|
|
21
|
+
When the feature file's path is requested
|
|
22
|
+
"""
|
|
23
|
+
@model.path
|
|
24
|
+
"""
|
|
25
|
+
Then the model returns "path_to/test_directory/foo.feature"
|
|
26
|
+
|
|
27
|
+
Scenario: Modeling a feature files's name
|
|
28
|
+
When the feature file's name is requested
|
|
29
|
+
"""
|
|
30
|
+
@model.name
|
|
31
|
+
"""
|
|
32
|
+
Then the model returns "foo.feature"
|
|
33
|
+
|
|
34
|
+
Scenario: Modeling a feature file's comments
|
|
35
|
+
When the feature file's comments are requested
|
|
36
|
+
"""
|
|
37
|
+
@model.comments
|
|
38
|
+
"""
|
|
39
|
+
Then the model returns models for the following comments:
|
|
40
|
+
| # A comment |
|
|
41
|
+
| # Another comment |
|
|
42
|
+
|
|
43
|
+
Scenario: Modeling a feature file's feature
|
|
44
|
+
When the feature file's feature is requested
|
|
45
|
+
"""
|
|
46
|
+
@model.feature
|
|
47
|
+
"""
|
|
48
|
+
Then the model returns a model for the following feature:
|
|
49
|
+
| Bar |
|