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.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +579 -572
  3. data/LICENSE.txt +22 -22
  4. data/README.md +135 -135
  5. data/cuke_modeler.gemspec +59 -59
  6. data/lib/cuke_modeler/adapters/gherkin_10_adapter.rb +13 -13
  7. data/lib/cuke_modeler/adapters/gherkin_11_adapter.rb +13 -13
  8. data/lib/cuke_modeler/adapters/gherkin_12_adapter.rb +13 -13
  9. data/lib/cuke_modeler/adapters/gherkin_13_adapter.rb +13 -13
  10. data/lib/cuke_modeler/adapters/gherkin_14_adapter.rb +13 -13
  11. data/lib/cuke_modeler/adapters/gherkin_15_adapter.rb +13 -13
  12. data/lib/cuke_modeler/adapters/gherkin_16_adapter.rb +13 -13
  13. data/lib/cuke_modeler/adapters/gherkin_17_adapter.rb +13 -13
  14. data/lib/cuke_modeler/adapters/gherkin_18_adapter.rb +27 -27
  15. data/lib/cuke_modeler/adapters/gherkin_19_adapter.rb +64 -64
  16. data/lib/cuke_modeler/adapters/gherkin_20_adapter.rb +359 -359
  17. data/lib/cuke_modeler/adapters/gherkin_21_adapter.rb +13 -13
  18. data/lib/cuke_modeler/adapters/gherkin_22_adapter.rb +13 -13
  19. data/lib/cuke_modeler/adapters/gherkin_23_adapter.rb +13 -13
  20. data/lib/cuke_modeler/adapters/gherkin_24_adapter.rb +13 -13
  21. data/lib/cuke_modeler/adapters/gherkin_25_adapter.rb +13 -13
  22. data/lib/cuke_modeler/adapters/gherkin_26_adapter.rb +13 -13
  23. data/lib/cuke_modeler/adapters/gherkin_27_adapter.rb +13 -13
  24. data/lib/cuke_modeler/adapters/gherkin_28_adapter.rb +13 -13
  25. data/lib/cuke_modeler/adapters/gherkin_29_adapter.rb +13 -13
  26. data/lib/cuke_modeler/adapters/gherkin_30_adapter.rb +13 -13
  27. data/lib/cuke_modeler/adapters/gherkin_31_adapter.rb +13 -13
  28. data/lib/cuke_modeler/adapters/gherkin_32_adapter.rb +13 -13
  29. data/lib/cuke_modeler/adapters/gherkin_33_adapter.rb +13 -13
  30. data/lib/cuke_modeler/adapters/gherkin_34_adapter.rb +13 -13
  31. data/lib/cuke_modeler/adapters/gherkin_35_adapter.rb +13 -13
  32. data/lib/cuke_modeler/adapters/gherkin_36_adapter.rb +13 -13
  33. data/lib/cuke_modeler/adapters/gherkin_37_adapter.rb +13 -13
  34. data/lib/cuke_modeler/adapters/gherkin_38_adapter.rb +13 -0
  35. data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +375 -375
  36. data/lib/cuke_modeler/adapters/gherkin_base_adapter.rb +17 -17
  37. data/lib/cuke_modeler/containing.rb +105 -105
  38. data/lib/cuke_modeler/described.rb +71 -71
  39. data/lib/cuke_modeler/models/background.rb +122 -122
  40. data/lib/cuke_modeler/models/cell.rb +88 -88
  41. data/lib/cuke_modeler/models/comment.rb +82 -82
  42. data/lib/cuke_modeler/models/directory.rb +143 -143
  43. data/lib/cuke_modeler/models/doc_string.rb +104 -104
  44. data/lib/cuke_modeler/models/example.rb +274 -274
  45. data/lib/cuke_modeler/models/feature.rb +200 -200
  46. data/lib/cuke_modeler/models/feature_file.rb +116 -116
  47. data/lib/cuke_modeler/models/model.rb +87 -87
  48. data/lib/cuke_modeler/models/outline.rb +145 -145
  49. data/lib/cuke_modeler/models/row.rb +104 -104
  50. data/lib/cuke_modeler/models/rule.rb +162 -162
  51. data/lib/cuke_modeler/models/scenario.rb +128 -128
  52. data/lib/cuke_modeler/models/step.rb +178 -178
  53. data/lib/cuke_modeler/models/table.rb +117 -117
  54. data/lib/cuke_modeler/models/tag.rb +75 -75
  55. data/lib/cuke_modeler/named.rb +26 -26
  56. data/lib/cuke_modeler/nested.rb +61 -61
  57. data/lib/cuke_modeler/parsed.rb +24 -24
  58. data/lib/cuke_modeler/parsing.rb +208 -208
  59. data/lib/cuke_modeler/sourceable.rb +29 -29
  60. data/lib/cuke_modeler/stepped.rb +34 -34
  61. data/lib/cuke_modeler/taggable.rb +57 -57
  62. data/lib/cuke_modeler/version.rb +4 -4
  63. data/lib/cuke_modeler.rb +32 -32
  64. data/testing/cucumber/features/analysis/step_comparison.feature +25 -25
  65. data/testing/cucumber/features/analysis/test_comparison.feature +35 -35
  66. data/testing/cucumber/features/modeling/background_modeling.feature +105 -105
  67. data/testing/cucumber/features/modeling/background_output.feature +60 -60
  68. data/testing/cucumber/features/modeling/cell_modeling.feature +68 -68
  69. data/testing/cucumber/features/modeling/cell_output.feature +36 -36
  70. data/testing/cucumber/features/modeling/comment_modeling.feature +62 -62
  71. data/testing/cucumber/features/modeling/comment_output.feature +40 -40
  72. data/testing/cucumber/features/modeling/directory_modeling.feature +62 -62
  73. data/testing/cucumber/features/modeling/directory_output.feature +33 -33
  74. data/testing/cucumber/features/modeling/doc_string_modeling.feature +85 -85
  75. data/testing/cucumber/features/modeling/doc_string_output.feature +50 -50
  76. data/testing/cucumber/features/modeling/example_modeling.feature +155 -155
  77. data/testing/cucumber/features/modeling/example_output.feature +57 -57
  78. data/testing/cucumber/features/modeling/feature_file_modeling.feature +49 -49
  79. data/testing/cucumber/features/modeling/feature_file_output.feature +33 -33
  80. data/testing/cucumber/features/modeling/feature_modeling.feature +149 -149
  81. data/testing/cucumber/features/modeling/feature_output.feature +144 -144
  82. data/testing/cucumber/features/modeling/model_output.feature +61 -61
  83. data/testing/cucumber/features/modeling/model_structure.feature +42 -42
  84. data/testing/cucumber/features/modeling/outline_modeling.feature +175 -175
  85. data/testing/cucumber/features/modeling/outline_output.feature +87 -87
  86. data/testing/cucumber/features/modeling/row_modeling.feature +70 -70
  87. data/testing/cucumber/features/modeling/row_output.feature +40 -40
  88. data/testing/cucumber/features/modeling/rule_modeling.feature +171 -171
  89. data/testing/cucumber/features/modeling/rule_output.feature +136 -136
  90. data/testing/cucumber/features/modeling/scenario_modeling.feature +146 -146
  91. data/testing/cucumber/features/modeling/scenario_output.feature +63 -63
  92. data/testing/cucumber/features/modeling/step_modeling.feature +105 -105
  93. data/testing/cucumber/features/modeling/step_output.feature +47 -47
  94. data/testing/cucumber/features/modeling/table_modeling.feature +73 -73
  95. data/testing/cucumber/features/modeling/table_output.feature +42 -42
  96. data/testing/cucumber/features/modeling/tag_modeling.feature +62 -62
  97. data/testing/cucumber/features/modeling/tag_output.feature +40 -40
  98. metadata +6 -8
@@ -1,61 +1,61 @@
1
- Feature: Model output
2
-
3
- All models can be output in text form via `#to_s`. For models that represent parts of the file structure, this text
4
- usually is a path. For models that represent parts of a feature file, this text usually is Gherkin. In any case, the
5
- output is in a format that can be used to create the same kind of model.
6
-
7
- Due to the nested nature of model relationships, the default output of `#inspect` can get...lengthy. For this reason,
8
- all models override `#inspect` to make it provide a minimal but useful amount of information on the model object.
9
- Switching between the minimal and the verbose (i.e. default Ruby behavior) version is controlled by a flag.
10
-
11
- See the model output documentation for specific models for details.
12
-
13
-
14
- Scenario: Stringify a model
15
- Given the models provided by CukeModeler
16
- Then all of them can be output as text appropriate to the model type
17
- """
18
- model = <model_class>.new
19
-
20
- model.to_s
21
- """
22
-
23
- Scenario: Inspect a model
24
-
25
- Note: The base model class, `CukeModeler::Model` lacks any "meaningful attributes"
26
-
27
- Given the models provided by CukeModeler
28
- Then all of them can provide a custom inspection output
29
- """
30
- model = <model_class>.new
31
-
32
- model.inspect
33
- """
34
- And the inspection values are of the form:
35
- """
36
- #<CukeModeler::<model_class>:<object_id> <some_meaningful_attribute>: <attribute_value>>
37
- """
38
- But the base model class inspection value is of the form:
39
- """
40
- #<CukeModeler::<model_class>:<object_id>>
41
- """
42
-
43
- Scenario: Controlling inspection output
44
-
45
- Note: Non-verbose inspection is the default behavior for models
46
-
47
- Given the models provided by CukeModeler
48
- When using non-verbose inspection
49
- """
50
- model = <model_class>.new
51
-
52
- model.inspect(verbose: false)
53
- """
54
- Then the custom model inspection is used
55
- When using verbose inspection
56
- """
57
- model = <model_class>.new
58
-
59
- model.inspect(verbose: true)
60
- """
61
- Then the default Ruby inspection is used
1
+ Feature: Model output
2
+
3
+ All models can be output in text form via `#to_s`. For models that represent parts of the file structure, this text
4
+ usually is a path. For models that represent parts of a feature file, this text usually is Gherkin. In any case, the
5
+ output is in a format that can be used to create the same kind of model.
6
+
7
+ Due to the nested nature of model relationships, the default output of `#inspect` can get...lengthy. For this reason,
8
+ all models override `#inspect` to make it provide a minimal but useful amount of information on the model object.
9
+ Switching between the minimal and the verbose (i.e. default Ruby behavior) version is controlled by a flag.
10
+
11
+ See the model output documentation for specific models for details.
12
+
13
+
14
+ Scenario: Stringify a model
15
+ Given the models provided by CukeModeler
16
+ Then all of them can be output as text appropriate to the model type
17
+ """
18
+ model = <model_class>.new
19
+
20
+ model.to_s
21
+ """
22
+
23
+ Scenario: Inspect a model
24
+
25
+ Note: The base model class, `CukeModeler::Model` lacks any "meaningful attributes"
26
+
27
+ Given the models provided by CukeModeler
28
+ Then all of them can provide a custom inspection output
29
+ """
30
+ model = <model_class>.new
31
+
32
+ model.inspect
33
+ """
34
+ And the inspection values are of the form:
35
+ """
36
+ #<CukeModeler::<model_class>:<object_id> <some_meaningful_attribute>: <attribute_value>>
37
+ """
38
+ But the base model class inspection value is of the form:
39
+ """
40
+ #<CukeModeler::<model_class>:<object_id>>
41
+ """
42
+
43
+ Scenario: Controlling inspection output
44
+
45
+ Note: Non-verbose inspection is the default behavior for models
46
+
47
+ Given the models provided by CukeModeler
48
+ When using non-verbose inspection
49
+ """
50
+ model = <model_class>.new
51
+
52
+ model.inspect(verbose: false)
53
+ """
54
+ Then the custom model inspection is used
55
+ When using verbose inspection
56
+ """
57
+ model = <model_class>.new
58
+
59
+ model.inspect(verbose: true)
60
+ """
61
+ Then the default Ruby inspection is used
@@ -1,42 +1,42 @@
1
- Feature: Model structure
2
-
3
- When modeling an existing test suite, that suite is parsed and models are created for each element of the suite. These models form a nested structure of parent and child models which has the same shape as whatever portion of the suite that they represent (see the documentation for specific models for details).
4
-
5
- However, all models can also be used in an 'abstract' manner. That is, they can be created without any input (such as a file path or snippet of Gherkin) that would normally be used for determining their structure and properties. In these cases, their parent/child relationships and properties can be set directly rather than being populated dynamically based on an actual test suite.
6
-
7
-
8
- Scenario: Creating abstract models
9
- Given the models provided by CukeModeler
10
- Then all of them can be created without further context
11
- """
12
- abstract_model = <model_class>.new
13
- """
14
-
15
- Scenario: Nesting models
16
- Given the models provided by CukeModeler
17
- Then all of them can contain other models
18
- """
19
- child_model = <model_class>.new
20
- parent_model = <model_class>.new
21
-
22
- parent_model.children << child_model
23
- """
24
- And all of them can be contained inside of another model
25
- """
26
- child_model = <model_class>.new
27
- parent_model = <model_class>.new
28
-
29
- child_model.parent_model = parent_model
30
- """
31
-
32
- Scenario: Accessing the parsing data
33
-
34
- Note: Directory models do not store any parsing data because parsing Gherkin source text does not come into play until the feature file level of modeling.
35
-
36
- Given the models provided by CukeModeler
37
- Then all of them provide access to the parsing data that was used to create them
38
- """
39
- model = <model_class>.new(<source_text>)
40
-
41
- model.parsing_data
42
- """
1
+ Feature: Model structure
2
+
3
+ When modeling an existing test suite, that suite is parsed and models are created for each element of the suite. These models form a nested structure of parent and child models which has the same shape as whatever portion of the suite that they represent (see the documentation for specific models for details).
4
+
5
+ However, all models can also be used in an 'abstract' manner. That is, they can be created without any input (such as a file path or snippet of Gherkin) that would normally be used for determining their structure and properties. In these cases, their parent/child relationships and properties can be set directly rather than being populated dynamically based on an actual test suite.
6
+
7
+
8
+ Scenario: Creating abstract models
9
+ Given the models provided by CukeModeler
10
+ Then all of them can be created without further context
11
+ """
12
+ abstract_model = <model_class>.new
13
+ """
14
+
15
+ Scenario: Nesting models
16
+ Given the models provided by CukeModeler
17
+ Then all of them can contain other models
18
+ """
19
+ child_model = <model_class>.new
20
+ parent_model = <model_class>.new
21
+
22
+ parent_model.children << child_model
23
+ """
24
+ And all of them can be contained inside of another model
25
+ """
26
+ child_model = <model_class>.new
27
+ parent_model = <model_class>.new
28
+
29
+ child_model.parent_model = parent_model
30
+ """
31
+
32
+ Scenario: Accessing the parsing data
33
+
34
+ Note: Directory models do not store any parsing data because parsing Gherkin source text does not come into play until the feature file level of modeling.
35
+
36
+ Given the models provided by CukeModeler
37
+ Then all of them provide access to the parsing data that was used to create them
38
+ """
39
+ model = <model_class>.new(<source_text>)
40
+
41
+ model.parsing_data
42
+ """
@@ -1,175 +1,175 @@
1
- Feature: Outline modeling
2
-
3
- Outline models represent a Scenario Outline portion of a feature. They expose several attributes of the outline that they represent, as well as containing models for the steps, tags, and examples that are present in that outline.
4
-
5
-
6
- Background:
7
- Given the following gherkin:
8
- """
9
- Scenario Outline: example outline
10
-
11
- Some background description.
12
-
13
- Some more.
14
- Even more.
15
-
16
-
17
- Given a <setup> step
18
- When an action step
19
- Then a <verification> step
20
-
21
- Examples: example 1
22
- | setup | verification |
23
- | x | y |
24
- Examples: example 2
25
- | setup | verification |
26
- | a | b |
27
- """
28
- And an outline model based on that gherkin
29
- """
30
- @model = CukeModeler::Outline.new(<source_text>)
31
- """
32
-
33
-
34
- Scenario: Modeling an outline's keyword
35
- When the outline's keyword is requested
36
- """
37
- @model.keyword
38
- """
39
- Then the model returns "Scenario Outline"
40
-
41
- Scenario: Modeling an outline's name
42
- When the outline's name is requested
43
- """
44
- @model.name
45
- """
46
- Then the model returns "example outline"
47
-
48
- Scenario: Modeling an outline's description
49
- When the outline's description is requested
50
- """
51
- @model.description
52
- """
53
- Then the model returns
54
- """
55
- Some background description.
56
-
57
- Some more.
58
- Even more.
59
- """
60
-
61
- Scenario: Modeling an outline's steps
62
- When the outline's steps are requested
63
- """
64
- @model.steps
65
- """
66
- Then the model returns models for the following steps:
67
- | a <setup> step |
68
- | an action step |
69
- | a <verification> step |
70
-
71
- Scenario: Modeling an outline's examples
72
- When the outline's examples are requested
73
- """
74
- @model.examples
75
- """
76
- Then the model returns models for the following examples:
77
- | example 1 |
78
- | example 2 |
79
-
80
- Scenario: Modeling an outline's tags
81
- Given the following gherkin:
82
- """
83
- @feature_tag
84
- Feature:
85
-
86
- @outline_tag_1
87
- @outline_tag_2
88
- Scenario Outline:
89
- Given a <setup> step
90
- When an action step
91
- Then a <verification> step
92
-
93
- Examples:
94
- | setup | verification |
95
- | x | y |
96
- """
97
- And a feature model based on that gherkin
98
- """
99
- @model = CukeModeler::Feature.new(<source_text>)
100
- """
101
- And the outline model of that feature model
102
- """
103
- @model = @model.outlines.first
104
- """
105
- When the outline's tags are requested
106
- """
107
- @model.tags
108
- """
109
- Then the model returns models for the following tags:
110
- | @outline_tag_1 |
111
- | @outline_tag_2 |
112
- When the outline's inherited tags are requested
113
- """
114
- @model.applied_tags
115
- """
116
- Then the model returns models for the following tags:
117
- | @feature_tag |
118
- When all of the outline's tags are requested
119
- """
120
- @model.all_tags
121
- """
122
- Then the model returns models for the following tags:
123
- | @feature_tag |
124
- | @outline_tag_1 |
125
- | @outline_tag_2 |
126
-
127
- Scenario: Modeling an outline's source line
128
- Given the following gherkin:
129
- """
130
- Feature:
131
-
132
- Scenario Outline:
133
- * a step
134
- Examples:
135
- | param |
136
- | value |
137
- """
138
- And a feature model based on that gherkin
139
- """
140
- @model = CukeModeler::Feature.new(<source_text>)
141
- """
142
- And the outline model of that feature model
143
- """
144
- @model = @model.outlines.first
145
- """
146
- When the outline's source line is requested
147
- """
148
- @model.source_line
149
- """
150
- Then the model returns "3"
151
-
152
- Scenario: Modeling an outline's source column
153
- Given the following gherkin:
154
- """
155
- Feature:
156
-
157
- Scenario Outline:
158
- * a step
159
- Examples:
160
- | param |
161
- | value |
162
- """
163
- And a feature model based on that gherkin
164
- """
165
- @model = CukeModeler::Feature.new(<source_text>)
166
- """
167
- And the outline model of that feature model
168
- """
169
- @model = @model.outlines.first
170
- """
171
- When the outline's source column is requested
172
- """
173
- @model.source_column
174
- """
175
- Then the model returns "3"
1
+ Feature: Outline modeling
2
+
3
+ Outline models represent a Scenario Outline portion of a feature. They expose several attributes of the outline that they represent, as well as containing models for the steps, tags, and examples that are present in that outline.
4
+
5
+
6
+ Background:
7
+ Given the following gherkin:
8
+ """
9
+ Scenario Outline: example outline
10
+
11
+ Some background description.
12
+
13
+ Some more.
14
+ Even more.
15
+
16
+
17
+ Given a <setup> step
18
+ When an action step
19
+ Then a <verification> step
20
+
21
+ Examples: example 1
22
+ | setup | verification |
23
+ | x | y |
24
+ Examples: example 2
25
+ | setup | verification |
26
+ | a | b |
27
+ """
28
+ And an outline model based on that gherkin
29
+ """
30
+ @model = CukeModeler::Outline.new(<source_text>)
31
+ """
32
+
33
+
34
+ Scenario: Modeling an outline's keyword
35
+ When the outline's keyword is requested
36
+ """
37
+ @model.keyword
38
+ """
39
+ Then the model returns "Scenario Outline"
40
+
41
+ Scenario: Modeling an outline's name
42
+ When the outline's name is requested
43
+ """
44
+ @model.name
45
+ """
46
+ Then the model returns "example outline"
47
+
48
+ Scenario: Modeling an outline's description
49
+ When the outline's description is requested
50
+ """
51
+ @model.description
52
+ """
53
+ Then the model returns
54
+ """
55
+ Some background description.
56
+
57
+ Some more.
58
+ Even more.
59
+ """
60
+
61
+ Scenario: Modeling an outline's steps
62
+ When the outline's steps are requested
63
+ """
64
+ @model.steps
65
+ """
66
+ Then the model returns models for the following steps:
67
+ | a <setup> step |
68
+ | an action step |
69
+ | a <verification> step |
70
+
71
+ Scenario: Modeling an outline's examples
72
+ When the outline's examples are requested
73
+ """
74
+ @model.examples
75
+ """
76
+ Then the model returns models for the following examples:
77
+ | example 1 |
78
+ | example 2 |
79
+
80
+ Scenario: Modeling an outline's tags
81
+ Given the following gherkin:
82
+ """
83
+ @feature_tag
84
+ Feature:
85
+
86
+ @outline_tag_1
87
+ @outline_tag_2
88
+ Scenario Outline:
89
+ Given a <setup> step
90
+ When an action step
91
+ Then a <verification> step
92
+
93
+ Examples:
94
+ | setup | verification |
95
+ | x | y |
96
+ """
97
+ And a feature model based on that gherkin
98
+ """
99
+ @model = CukeModeler::Feature.new(<source_text>)
100
+ """
101
+ And the outline model of that feature model
102
+ """
103
+ @model = @model.outlines.first
104
+ """
105
+ When the outline's tags are requested
106
+ """
107
+ @model.tags
108
+ """
109
+ Then the model returns models for the following tags:
110
+ | @outline_tag_1 |
111
+ | @outline_tag_2 |
112
+ When the outline's inherited tags are requested
113
+ """
114
+ @model.applied_tags
115
+ """
116
+ Then the model returns models for the following tags:
117
+ | @feature_tag |
118
+ When all of the outline's tags are requested
119
+ """
120
+ @model.all_tags
121
+ """
122
+ Then the model returns models for the following tags:
123
+ | @feature_tag |
124
+ | @outline_tag_1 |
125
+ | @outline_tag_2 |
126
+
127
+ Scenario: Modeling an outline's source line
128
+ Given the following gherkin:
129
+ """
130
+ Feature:
131
+
132
+ Scenario Outline:
133
+ * a step
134
+ Examples:
135
+ | param |
136
+ | value |
137
+ """
138
+ And a feature model based on that gherkin
139
+ """
140
+ @model = CukeModeler::Feature.new(<source_text>)
141
+ """
142
+ And the outline model of that feature model
143
+ """
144
+ @model = @model.outlines.first
145
+ """
146
+ When the outline's source line is requested
147
+ """
148
+ @model.source_line
149
+ """
150
+ Then the model returns "3"
151
+
152
+ Scenario: Modeling an outline's source column
153
+ Given the following gherkin:
154
+ """
155
+ Feature:
156
+
157
+ Scenario Outline:
158
+ * a step
159
+ Examples:
160
+ | param |
161
+ | value |
162
+ """
163
+ And a feature model based on that gherkin
164
+ """
165
+ @model = CukeModeler::Feature.new(<source_text>)
166
+ """
167
+ And the outline model of that feature model
168
+ """
169
+ @model = @model.outlines.first
170
+ """
171
+ When the outline's source column is requested
172
+ """
173
+ @model.source_column
174
+ """
175
+ Then the model returns "3"