cuke_modeler 3.13.0 → 3.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7e797a40be9122031fb1af313da9c05ded38167a525751135a27d711e901768
4
- data.tar.gz: 6f793fedb5971b37d0733ca53d997b6f334c2e51716dff9b9c0cc2000ecc9c03
3
+ metadata.gz: 42e13fd543b846c0dfd1120e67c157aefb71eeeae7bc68894686813368aace1a
4
+ data.tar.gz: 676f7198e3746318b0f4a2d79c3a8c410ebcbab00b3e543dbb225cfaa8f4ee58
5
5
  SHA512:
6
- metadata.gz: d1f6c8cbc8325af57aaae715afbfd12d96b279ae54a96ee0daedcb861f13fd10e662e0d350ef0139ab483c4423160844415fb7d0c7037c1e34e5fd498856a30f
7
- data.tar.gz: 41100c94a4eaedc6de3ef4d57c0aa1ba93abd962c149d24d3852184bf34c83470a5ed381111918d3eefeb17eba290d2d08241722cacf54b43c4ed5aeba51f12c
6
+ metadata.gz: 8500092bdeeb98f81134b8e3302ddf796acd867ccd1324b09d2d75103902b6a926d1220ddbaf08aea98624fe64f1246804868fee21e56a9ec24766c0695455f3
7
+ data.tar.gz: 939fc0d59e4cf3cc194ac28f51a140c928e4ce61f493cc21b03b9a9140c80981fc9e25dbadaa46a4c09f187b8610f37d76a52b708f2ca6434500b2f7324bca7c
data/CHANGELOG.md CHANGED
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  Nothing yet...
10
10
 
11
+ ## [3.14.0] - 2021-11-22
12
+
13
+ ### Added
14
+ - All models for Gherkin elements now track the column number from which they originate in a source file.
15
+
11
16
  ## [3.13.0] - 2021-09-25
12
17
 
13
18
  ### Added
@@ -408,7 +413,8 @@ Nothing yet...
408
413
  - Initial release
409
414
 
410
415
 
411
- [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.13.0...HEAD
416
+ [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.14.0...HEAD
417
+ [3.14.0]: https://github.com/enkessler/cuke_modeler/compare/v3.13.0...v3.14.0
412
418
  [3.13.0]: https://github.com/enkessler/cuke_modeler/compare/v3.12.0...v3.13.0
413
419
  [3.12.0]: https://github.com/enkessler/cuke_modeler/compare/v3.11.0...v3.12.0
414
420
  [3.11.0]: https://github.com/enkessler/cuke_modeler/compare/v3.10.0...v3.11.0
@@ -39,6 +39,7 @@ module CukeModeler
39
39
  adapted_feature['name'] = feature_ast.name
40
40
  adapted_feature['description'] = feature_ast.description
41
41
  adapted_feature['line'] = feature_ast.location.line
42
+ adapted_feature['column'] = feature_ast.location.column
42
43
 
43
44
  adapted_feature['elements'] = adapt_child_elements(feature_ast)
44
45
  adapted_feature['tags'] = adapt_tags(feature_ast)
@@ -59,6 +60,7 @@ module CukeModeler
59
60
  adapted_background['name'] = background_ast.background.name
60
61
  adapted_background['description'] = background_ast.background.description
61
62
  adapted_background['line'] = background_ast.background.location.line
63
+ adapted_background['column'] = background_ast.background.location.column
62
64
 
63
65
  adapted_background['steps'] = adapt_steps(background_ast.background)
64
66
 
@@ -79,6 +81,7 @@ module CukeModeler
79
81
  adapted_rule['name'] = rule_ast.rule.name
80
82
  adapted_rule['description'] = rule_ast.rule.description
81
83
  adapted_rule['line'] = rule_ast.rule.location.line
84
+ adapted_rule['column'] = rule_ast.rule.location.column
82
85
 
83
86
  adapted_rule['elements'] = adapt_child_elements(rule_ast.rule)
84
87
  adapted_rule['tags'] = adapt_tags(rule_ast.rule)
@@ -100,6 +103,7 @@ module CukeModeler
100
103
  adapted_scenario['name'] = test_ast.scenario.name
101
104
  adapted_scenario['description'] = test_ast.scenario.description
102
105
  adapted_scenario['line'] = test_ast.scenario.location.line
106
+ adapted_scenario['column'] = test_ast.scenario.location.column
103
107
 
104
108
  adapted_scenario['tags'] = adapt_tags(test_ast.scenario)
105
109
  adapted_scenario['steps'] = adapt_steps(test_ast.scenario)
@@ -122,6 +126,7 @@ module CukeModeler
122
126
  adapted_outline['name'] = test_ast.scenario.name
123
127
  adapted_outline['description'] = test_ast.scenario.description
124
128
  adapted_outline['line'] = test_ast.scenario.location.line
129
+ adapted_outline['column'] = test_ast.scenario.location.column
125
130
 
126
131
  adapted_outline['tags'] = adapt_tags(test_ast.scenario)
127
132
  adapted_outline['steps'] = adapt_steps(test_ast.scenario)
@@ -143,6 +148,7 @@ module CukeModeler
143
148
  adapted_example['keyword'] = example_ast.keyword
144
149
  adapted_example['name'] = example_ast.name
145
150
  adapted_example['line'] = example_ast.location.line
151
+ adapted_example['column'] = example_ast.location.column
146
152
  adapted_example['description'] = example_ast.description
147
153
 
148
154
  adapted_example['rows'] = []
@@ -166,6 +172,7 @@ module CukeModeler
166
172
 
167
173
  adapted_tag['name'] = tag_ast.name
168
174
  adapted_tag['line'] = tag_ast.location.line
175
+ adapted_tag['column'] = tag_ast.location.column
169
176
 
170
177
  adapted_tag
171
178
  end
@@ -179,6 +186,7 @@ module CukeModeler
179
186
 
180
187
  adapted_comment['text'] = comment_ast.text
181
188
  adapted_comment['line'] = comment_ast.location.line
189
+ adapted_comment['column'] = comment_ast.location.column
182
190
 
183
191
  adapted_comment
184
192
  end
@@ -195,6 +203,7 @@ module CukeModeler
195
203
  adapted_step['keyword'] = step_ast.keyword
196
204
  adapted_step['name'] = step_ast.text
197
205
  adapted_step['line'] = step_ast.location.line
206
+ adapted_step['column'] = step_ast.location.column
198
207
 
199
208
  if step_ast.doc_string
200
209
  adapted_step['doc_string'] = adapt_doc_string(step_ast.doc_string)
@@ -215,6 +224,7 @@ module CukeModeler
215
224
  adapted_doc_string['value'] = doc_string_ast.content
216
225
  adapted_doc_string['content_type'] = doc_string_ast.media_type
217
226
  adapted_doc_string['line'] = doc_string_ast.location.line
227
+ adapted_doc_string['column'] = doc_string_ast.location.column
218
228
 
219
229
  adapted_doc_string
220
230
  end
@@ -232,6 +242,7 @@ module CukeModeler
232
242
  adapted_step_table['rows'] << adapt_table_row(row)
233
243
  end
234
244
  adapted_step_table['line'] = step_table_ast.location.line
245
+ adapted_step_table['column'] = step_table_ast.location.column
235
246
 
236
247
  adapted_step_table
237
248
  end
@@ -245,6 +256,7 @@ module CukeModeler
245
256
  clear_child_elements(adapted_table_row, [[:cells]])
246
257
 
247
258
  adapted_table_row['line'] = table_row_ast.location.line
259
+ adapted_table_row['column'] = table_row_ast.location.column
248
260
 
249
261
  adapted_table_row['cells'] = []
250
262
  table_row_ast.cells.each do |row|
@@ -263,6 +275,7 @@ module CukeModeler
263
275
 
264
276
  adapted_cell['value'] = cell_ast.value
265
277
  adapted_cell['line'] = cell_ast.location.line
278
+ adapted_cell['column'] = cell_ast.location.column
266
279
 
267
280
  adapted_cell
268
281
  end
@@ -40,6 +40,7 @@ module CukeModeler
40
40
  adapted_feature['name'] = feature_ast[:name]
41
41
  adapted_feature['description'] = feature_ast[:description] || ''
42
42
  adapted_feature['line'] = feature_ast[:location][:line]
43
+ adapted_feature['column'] = feature_ast[:location][:column]
43
44
 
44
45
  adapted_feature['elements'] = adapt_child_elements(feature_ast)
45
46
  adapted_feature['tags'] = adapt_tags(feature_ast)
@@ -60,6 +61,7 @@ module CukeModeler
60
61
  adapted_background['name'] = background_ast[:background][:name]
61
62
  adapted_background['description'] = background_ast[:background][:description] || ''
62
63
  adapted_background['line'] = background_ast[:background][:location][:line]
64
+ adapted_background['column'] = background_ast[:background][:location][:column]
63
65
 
64
66
  adapted_background['steps'] = adapt_steps(background_ast[:background])
65
67
 
@@ -79,6 +81,7 @@ module CukeModeler
79
81
  adapted_rule['name'] = rule_ast[:rule][:name]
80
82
  adapted_rule['description'] = rule_ast[:rule][:description] || ''
81
83
  adapted_rule['line'] = rule_ast[:rule][:location][:line]
84
+ adapted_rule['column'] = rule_ast[:rule][:location][:column]
82
85
 
83
86
  adapted_rule['elements'] = adapt_child_elements(rule_ast[:rule])
84
87
 
@@ -99,6 +102,7 @@ module CukeModeler
99
102
  adapted_scenario['name'] = test_ast[:scenario][:name]
100
103
  adapted_scenario['description'] = test_ast[:scenario][:description] || ''
101
104
  adapted_scenario['line'] = test_ast[:scenario][:location][:line]
105
+ adapted_scenario['column'] = test_ast[:scenario][:location][:column]
102
106
 
103
107
  adapted_scenario['tags'] = adapt_tags(test_ast[:scenario])
104
108
  adapted_scenario['steps'] = adapt_steps(test_ast[:scenario])
@@ -121,6 +125,7 @@ module CukeModeler
121
125
  adapted_outline['name'] = test_ast[:scenario][:name]
122
126
  adapted_outline['description'] = test_ast[:scenario][:description] || ''
123
127
  adapted_outline['line'] = test_ast[:scenario][:location][:line]
128
+ adapted_outline['column'] = test_ast[:scenario][:location][:column]
124
129
 
125
130
  adapted_outline['tags'] = adapt_tags(test_ast[:scenario])
126
131
  adapted_outline['steps'] = adapt_steps(test_ast[:scenario])
@@ -142,6 +147,7 @@ module CukeModeler
142
147
  adapted_example['keyword'] = example_ast[:keyword]
143
148
  adapted_example['name'] = example_ast[:name]
144
149
  adapted_example['line'] = example_ast[:location][:line]
150
+ adapted_example['column'] = example_ast[:location][:column]
145
151
  adapted_example['description'] = example_ast[:description] || ''
146
152
 
147
153
  adapted_example['rows'] = []
@@ -165,6 +171,7 @@ module CukeModeler
165
171
 
166
172
  adapted_tag['name'] = tag_ast[:name]
167
173
  adapted_tag['line'] = tag_ast[:location][:line]
174
+ adapted_tag['column'] = tag_ast[:location][:column]
168
175
 
169
176
  adapted_tag
170
177
  end
@@ -178,6 +185,7 @@ module CukeModeler
178
185
 
179
186
  adapted_comment['text'] = comment_ast[:text]
180
187
  adapted_comment['line'] = comment_ast[:location][:line]
188
+ adapted_comment['column'] = comment_ast[:location][:column]
181
189
 
182
190
  adapted_comment
183
191
  end
@@ -194,6 +202,7 @@ module CukeModeler
194
202
  adapted_step['keyword'] = step_ast[:keyword]
195
203
  adapted_step['name'] = step_ast[:text]
196
204
  adapted_step['line'] = step_ast[:location][:line]
205
+ adapted_step['column'] = step_ast[:location][:column]
197
206
 
198
207
  if step_ast[:doc_string]
199
208
  adapted_step['doc_string'] = adapt_doc_string(step_ast[:doc_string])
@@ -214,6 +223,7 @@ module CukeModeler
214
223
  adapted_doc_string['value'] = doc_string_ast[:content]
215
224
  adapted_doc_string['content_type'] = doc_string_ast[:media_type]
216
225
  adapted_doc_string['line'] = doc_string_ast[:location][:line]
226
+ adapted_doc_string['column'] = doc_string_ast[:location][:column]
217
227
 
218
228
  adapted_doc_string
219
229
  end
@@ -231,6 +241,7 @@ module CukeModeler
231
241
  adapted_step_table['rows'] << adapt_table_row(row)
232
242
  end
233
243
  adapted_step_table['line'] = step_table_ast[:location][:line]
244
+ adapted_step_table['column'] = step_table_ast[:location][:column]
234
245
 
235
246
  adapted_step_table
236
247
  end
@@ -244,6 +255,7 @@ module CukeModeler
244
255
  clear_child_elements(adapted_table_row, [[:cells]])
245
256
 
246
257
  adapted_table_row['line'] = table_row_ast[:location][:line]
258
+ adapted_table_row['column'] = table_row_ast[:location][:column]
247
259
 
248
260
  adapted_table_row['cells'] = []
249
261
  table_row_ast[:cells].each do |row|
@@ -262,6 +274,7 @@ module CukeModeler
262
274
 
263
275
  adapted_cell['value'] = cell_ast[:value]
264
276
  adapted_cell['line'] = cell_ast[:location][:line]
277
+ adapted_cell['column'] = cell_ast[:location][:column]
265
278
 
266
279
  adapted_cell
267
280
  end
@@ -55,7 +55,7 @@ module CukeModeler
55
55
 
56
56
  def populate_scenario(scenario_object, parsed_scenario_data)
57
57
  populate_parsing_data(scenario_object, parsed_scenario_data)
58
- populate_source_line(scenario_object, parsed_scenario_data)
58
+ populate_source_location(scenario_object, parsed_scenario_data)
59
59
  populate_keyword(scenario_object, parsed_scenario_data)
60
60
  populate_name(scenario_object, parsed_scenario_data)
61
61
  populate_description(scenario_object, parsed_scenario_data)
@@ -65,7 +65,7 @@ module CukeModeler
65
65
 
66
66
  def populate_outline(outline_object, parsed_outline_data)
67
67
  populate_parsing_data(outline_object, parsed_outline_data)
68
- populate_source_line(outline_object, parsed_outline_data)
68
+ populate_source_location(outline_object, parsed_outline_data)
69
69
  populate_keyword(outline_object, parsed_outline_data)
70
70
  populate_name(outline_object, parsed_outline_data)
71
71
  populate_description(outline_object, parsed_outline_data)
@@ -79,7 +79,7 @@ module CukeModeler
79
79
  populate_keyword(background_object, parsed_background_data)
80
80
  populate_name(background_object, parsed_background_data)
81
81
  populate_description(background_object, parsed_background_data)
82
- populate_source_line(background_object, parsed_background_data)
82
+ populate_source_location(background_object, parsed_background_data)
83
83
  populate_steps(background_object, parsed_background_data)
84
84
  end
85
85
 
@@ -87,7 +87,7 @@ module CukeModeler
87
87
  populate_text(step_object, parsed_step_data)
88
88
  populate_block(step_object, parsed_step_data)
89
89
  populate_keyword(step_object, parsed_step_data)
90
- populate_source_line(step_object, parsed_step_data)
90
+ populate_source_location(step_object, parsed_step_data)
91
91
  populate_parsing_data(step_object, parsed_step_data)
92
92
  end
93
93
 
@@ -102,12 +102,12 @@ module CukeModeler
102
102
  def populate_table(table_object, parsed_table_data)
103
103
  populate_row_models(table_object, parsed_table_data)
104
104
  populate_parsing_data(table_object, parsed_table_data)
105
- populate_source_line(table_object, parsed_table_data)
105
+ populate_source_location(table_object, parsed_table_data)
106
106
  end
107
107
 
108
108
  def populate_cell(cell_object, parsed_cell_data)
109
109
  populate_cell_value(cell_object, parsed_cell_data)
110
- populate_source_line(cell_object, parsed_cell_data)
110
+ populate_source_location(cell_object, parsed_cell_data)
111
111
  populate_parsing_data(cell_object, parsed_cell_data)
112
112
  end
113
113
 
@@ -115,13 +115,13 @@ module CukeModeler
115
115
  populate_content_type(doc_string_object, parsed_doc_string_data)
116
116
  populate_content(doc_string_object, parsed_doc_string_data)
117
117
  populate_parsing_data(doc_string_object, parsed_doc_string_data)
118
- populate_source_line(doc_string_object, parsed_doc_string_data)
118
+ populate_source_location(doc_string_object, parsed_doc_string_data)
119
119
  end
120
120
 
121
121
  def populate_example(example_object, parsed_example_data)
122
122
  populate_parsing_data(example_object, parsed_example_data)
123
123
  populate_keyword(example_object, parsed_example_data)
124
- populate_source_line(example_object, parsed_example_data)
124
+ populate_source_location(example_object, parsed_example_data)
125
125
  populate_name(example_object, parsed_example_data)
126
126
  populate_description(example_object, parsed_example_data)
127
127
  populate_tags(example_object, parsed_example_data)
@@ -129,14 +129,14 @@ module CukeModeler
129
129
  end
130
130
 
131
131
  def populate_row(row_object, parsed_row_data)
132
- populate_source_line(row_object, parsed_row_data)
132
+ populate_source_location(row_object, parsed_row_data)
133
133
  populate_row_cells(row_object, parsed_row_data)
134
134
  populate_parsing_data(row_object, parsed_row_data)
135
135
  end
136
136
 
137
137
  def populate_feature(feature_object, parsed_feature_data)
138
138
  populate_parsing_data(feature_object, parsed_feature_data)
139
- populate_source_line(feature_object, parsed_feature_data)
139
+ populate_source_location(feature_object, parsed_feature_data)
140
140
  populate_keyword(feature_object, parsed_feature_data)
141
141
  populate_name(feature_object, parsed_feature_data)
142
142
  populate_description(feature_object, parsed_feature_data)
@@ -146,7 +146,7 @@ module CukeModeler
146
146
 
147
147
  def populate_rule(rule_object, parsed_rule_data)
148
148
  populate_parsing_data(rule_object, parsed_rule_data)
149
- populate_source_line(rule_object, parsed_rule_data)
149
+ populate_source_location(rule_object, parsed_rule_data)
150
150
  populate_keyword(rule_object, parsed_rule_data)
151
151
  populate_name(rule_object, parsed_rule_data)
152
152
  populate_description(rule_object, parsed_rule_data)
@@ -182,13 +182,13 @@ module CukeModeler
182
182
  def populate_tag(tag_object, processed_tag_data)
183
183
  populate_name(tag_object, processed_tag_data)
184
184
  populate_parsing_data(tag_object, processed_tag_data)
185
- populate_source_line(tag_object, processed_tag_data)
185
+ populate_source_location(tag_object, processed_tag_data)
186
186
  end
187
187
 
188
188
  def populate_comment(comment_object, processed_comment_data)
189
189
  populate_comment_text(comment_object, processed_comment_data)
190
190
  populate_parsing_data(comment_object, processed_comment_data)
191
- populate_source_line(comment_object, processed_comment_data)
191
+ populate_source_location(comment_object, processed_comment_data)
192
192
  end
193
193
 
194
194
  def populate_comment_text(comment_model, parsed_comment_data)
@@ -8,12 +8,15 @@ module CukeModeler
8
8
  # The line number where the element began in the source code
9
9
  attr_accessor :source_line
10
10
 
11
+ # The column number where the element began in the source code
12
+ attr_accessor :source_column
11
13
 
12
14
  private
13
15
 
14
16
 
15
- def populate_source_line(model, parsed_model_data)
17
+ def populate_source_location(model, parsed_model_data)
16
18
  model.source_line = parsed_model_data['line']
19
+ model.source_column = parsed_model_data['column']
17
20
  end
18
21
 
19
22
  end
@@ -1,4 +1,4 @@
1
1
  module CukeModeler
2
2
  # The gem version
3
- VERSION = '3.13.0'.freeze
3
+ VERSION = '3.14.0'.freeze
4
4
  end
@@ -23,21 +23,21 @@ Feature: Background modeling
23
23
  """
24
24
 
25
25
 
26
- Scenario: Modeling a backgrounds's keyword
26
+ Scenario: Modeling a background's keyword
27
27
  When the backgrounds's keyword is requested
28
28
  """
29
29
  @model.keyword
30
30
  """
31
31
  Then the model returns "Background"
32
32
 
33
- Scenario: Modeling a backgrounds's name
33
+ Scenario: Modeling a background's name
34
34
  When the background's name is requested
35
35
  """
36
36
  @model.name
37
37
  """
38
38
  Then the model returns "Some general test setup stuff."
39
39
 
40
- Scenario: Modeling a backgrounds's description
40
+ Scenario: Modeling a background's description
41
41
  When the background's description is requested
42
42
  """
43
43
  @model.description
@@ -50,7 +50,7 @@ Feature: Background modeling
50
50
  Even more.
51
51
  """
52
52
 
53
- Scenario: Modeling a backgrounds's steps
53
+ Scenario: Modeling a background's steps
54
54
  When the background's steps are requested
55
55
  """
56
56
  @model.steps
@@ -60,7 +60,7 @@ Feature: Background modeling
60
60
  | another setup step |
61
61
  | an action step |
62
62
 
63
- Scenario: Modeling a backgrounds's source line
63
+ Scenario: Modeling a background's source line
64
64
  Given the following gherkin:
65
65
  """
66
66
  Feature:
@@ -81,3 +81,26 @@ Feature: Background modeling
81
81
  @model.source_line
82
82
  """
83
83
  Then the model returns "3"
84
+
85
+ Scenario: Modeling a background's source column
86
+ Given the following gherkin:
87
+ """
88
+ Feature:
89
+
90
+
91
+ Background:
92
+ * a step
93
+ """
94
+ And a feature model based on that gherkin
95
+ """
96
+ @model = CukeModeler::Feature.new(<source_text>)
97
+ """
98
+ And the background model of that feature model
99
+ """
100
+ @model = @model.background
101
+ """
102
+ When the background's source column is requested
103
+ """
104
+ @model.source_column
105
+ """
106
+ Then the model returns "3"
@@ -20,3 +20,49 @@ Feature: Cell modeling
20
20
  @model.value
21
21
  """
22
22
  Then the model returns "foo"
23
+
24
+ Scenario: Modeling a cell's source line
25
+ Given the following gherkin:
26
+ """
27
+ Feature:
28
+
29
+ Scenario:
30
+ * a step
31
+ | foo |
32
+ """
33
+ And a feature model based on that gherkin
34
+ """
35
+ @model = CukeModeler::Feature.new(<source_text>)
36
+ """
37
+ And the cell model inside of that feature model
38
+ """
39
+ @model = @model.tests.first.steps.first.block.rows.first.cells.first
40
+ """
41
+ When the cell's source line is requested
42
+ """
43
+ @model.source_line
44
+ """
45
+ Then the model returns "5"
46
+
47
+ Scenario: Modeling a cell's source column
48
+ Given the following gherkin:
49
+ """
50
+ Feature:
51
+
52
+ Scenario:
53
+ * a step
54
+ | foo |
55
+ """
56
+ And a feature model based on that gherkin
57
+ """
58
+ @model = CukeModeler::Feature.new(<source_text>)
59
+ """
60
+ And the cell model inside of that feature model
61
+ """
62
+ @model = @model.tests.first.steps.first.block.rows.first.cells.first
63
+ """
64
+ When the cell's source column is requested
65
+ """
66
+ @model.source_column
67
+ """
68
+ Then the model returns "9"
@@ -40,3 +40,23 @@ Feature: Comment modeling
40
40
  @model.source_line
41
41
  """
42
42
  Then the model returns "1"
43
+
44
+ Scenario: Modeling a comment's source column
45
+ Given a feature file with the following gherkin:
46
+ """
47
+ # a comment
48
+ Feature:
49
+ """
50
+ And a feature file model based on that file
51
+ """
52
+ @model = CukeModeler::FeatureFile.new(<file_path>)
53
+ """
54
+ And the comment model of that feature file model
55
+ """
56
+ @model = @model.comments.first
57
+ """
58
+ When the comment's source column is requested
59
+ """
60
+ @model.source_column
61
+ """
62
+ Then the model returns "1"
@@ -57,3 +57,29 @@ Feature: Doc string modeling
57
57
  @model.source_line
58
58
  """
59
59
  Then the model returns "5"
60
+
61
+
62
+ Scenario: Modeling a doc string's source column
63
+ Given the following gherkin:
64
+ """
65
+ Feature:
66
+
67
+ Scenario:
68
+ * a step
69
+ \"\"\"
70
+ foo
71
+ \"\"\"
72
+ """
73
+ And a feature model based on that gherkin
74
+ """
75
+ @model = CukeModeler::Feature.new(<source_text>)
76
+ """
77
+ And the doc string model inside of that feature model
78
+ """
79
+ @model = @model.tests.first.steps.first.block
80
+ """
81
+ When the doc string's source column is requested
82
+ """
83
+ @model.source_column
84
+ """
85
+ Then the model returns "7"
@@ -128,3 +128,28 @@ Feature: Example modeling
128
128
  @model.source_line
129
129
  """
130
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"
@@ -132,3 +132,10 @@ that feature.
132
132
  @model.source_line
133
133
  """
134
134
  Then the model returns "2"
135
+
136
+ Scenario: Modeling a feature's source column
137
+ When the feature's source column is requested
138
+ """
139
+ @model.source_column
140
+ """
141
+ Then the model returns "1"
@@ -124,7 +124,7 @@ Feature: Outline modeling
124
124
  | @outline_tag_1 |
125
125
  | @outline_tag_2 |
126
126
 
127
- Scenario: Modeling a outline's source line
127
+ Scenario: Modeling an outline's source line
128
128
  Given the following gherkin:
129
129
  """
130
130
  Feature:
@@ -148,3 +148,28 @@ Feature: Outline modeling
148
148
  @model.source_line
149
149
  """
150
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"
@@ -45,3 +45,26 @@ Feature: Row modeling
45
45
  @model.source_line
46
46
  """
47
47
  Then the model returns "5"
48
+
49
+ Scenario: Modeling a row's source column
50
+ Given the following gherkin:
51
+ """
52
+ Feature:
53
+
54
+ Scenario:
55
+ * a step
56
+ | foo |
57
+ """
58
+ And a feature model based on that gherkin
59
+ """
60
+ @model = CukeModeler::Feature.new(<source_text>)
61
+ """
62
+ And the row model inside of that feature model
63
+ """
64
+ @model = @model.tests.first.steps.first.block.rows.first
65
+ """
66
+ When the rows's source column is requested
67
+ """
68
+ @model.source_column
69
+ """
70
+ Then the model returns "7"
@@ -148,3 +148,24 @@ in that rule.
148
148
  @model.source_line
149
149
  """
150
150
  Then the model returns "3"
151
+
152
+ Scenario: Modeling a rule's source column
153
+ Given the following gherkin:
154
+ """
155
+ Feature:
156
+
157
+ Rule:
158
+ """
159
+ And a feature model based on that gherkin
160
+ """
161
+ @model = CukeModeler::Feature.new(<source_text>)
162
+ """
163
+ And the rule model of that feature model
164
+ """
165
+ @model = @model.rules.first
166
+ """
167
+ When the rule's source column is requested
168
+ """
169
+ @model.source_column
170
+ """
171
+ Then the model returns "3"
@@ -122,3 +122,25 @@ Feature: Scenario modeling
122
122
  @model.source_line
123
123
  """
124
124
  Then the model returns "3"
125
+
126
+ Scenario: Modeling a scenario's source column
127
+ Given the following gherkin:
128
+ """
129
+ Feature:
130
+
131
+ Scenario:
132
+ * a step
133
+ """
134
+ And a feature model based on that gherkin
135
+ """
136
+ @model = CukeModeler::Feature.new(<source_text>)
137
+ """
138
+ And the scenario model of that feature model
139
+ """
140
+ @model = @model.scenarios.first
141
+ """
142
+ When the scenario's source column is requested
143
+ """
144
+ @model.source_column
145
+ """
146
+ Then the model returns "3"
@@ -50,6 +50,28 @@ Feature: Step modeling
50
50
  """
51
51
  Then the model returns "4"
52
52
 
53
+ Scenario: Modeling a step's source column
54
+ Given the following gherkin:
55
+ """
56
+ Feature:
57
+
58
+ Scenario:
59
+ * a step
60
+ """
61
+ And a feature model based on that gherkin
62
+ """
63
+ @model = CukeModeler::Feature.new(<source_text>)
64
+ """
65
+ And the step model inside of that feature model
66
+ """
67
+ @model = @model.tests.first.steps.first
68
+ """
69
+ When the step's source column is requested
70
+ """
71
+ @model.source_column
72
+ """
73
+ Then the model returns "5"
74
+
53
75
  Scenario: Modeling a step's table
54
76
  Given a step model based on the following gherkin:
55
77
  """
@@ -47,3 +47,27 @@ Feature: Table modeling
47
47
  @model.source_line
48
48
  """
49
49
  Then the model returns "5"
50
+
51
+ Scenario: Modeling a table's source column
52
+ Given the following gherkin:
53
+ """
54
+ Feature:
55
+
56
+ Scenario:
57
+ * a step
58
+ | value 1 |
59
+ | value 2 |
60
+ """
61
+ And a feature model based on that gherkin
62
+ """
63
+ @model = CukeModeler::Feature.new(<source_text>)
64
+ """
65
+ And the table model inside of that feature model
66
+ """
67
+ @model = @model.tests.first.steps.first.block
68
+ """
69
+ When the table's source column is requested
70
+ """
71
+ @model.source_column
72
+ """
73
+ Then the model returns "7"
@@ -40,3 +40,23 @@ Feature: Tag modeling
40
40
  @model.source_line
41
41
  """
42
42
  Then the model returns "1"
43
+
44
+ Scenario: Modeling a tag's source column
45
+ Given the following gherkin:
46
+ """
47
+ @a_tag
48
+ Feature:
49
+ """
50
+ And a feature model based on that gherkin
51
+ """
52
+ @model = CukeModeler::Feature.new(<source_text>)
53
+ """
54
+ And the tag model of that feature model
55
+ """
56
+ @model = @model.tags.first
57
+ """
58
+ When the tag's source column is requested
59
+ """
60
+ @model.source_column
61
+ """
62
+ Then the model returns "1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke_modeler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 3.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-25 00:00:00.000000000 Z
11
+ date: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-gherkin