cuke_modeler 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +16 -0
  3. data/Gemfile +11 -3
  4. data/History.md +5 -0
  5. data/LICENSE.txt +1 -1
  6. data/Rakefile +8 -1
  7. data/appveyor.yml +7 -12
  8. data/cuke_modeler.gemspec +2 -2
  9. data/lib/cuke_modeler/adapters/gherkin_6_adapter.rb +309 -0
  10. data/lib/cuke_modeler/parsing.rb +28 -5
  11. data/lib/cuke_modeler/version.rb +1 -1
  12. data/testing/cucumber/step_definitions/feature_file_steps.rb +1 -1
  13. data/testing/cucumber/step_definitions/modeling_steps.rb +2 -2
  14. data/testing/cucumber/step_definitions/verification_steps.rb +3 -2
  15. data/testing/file_helper.rb +3 -0
  16. data/testing/gemfiles/gherkin2.gemfile +7 -0
  17. data/testing/gemfiles/gherkin3.gemfile +6 -0
  18. data/testing/gemfiles/gherkin4.gemfile +7 -0
  19. data/testing/gemfiles/gherkin5.gemfile +6 -0
  20. data/testing/gemfiles/gherkin6.gemfile +10 -0
  21. data/testing/rspec/spec/integration/background_integration_spec.rb +80 -72
  22. data/testing/rspec/spec/integration/cell_integration_spec.rb +28 -20
  23. data/testing/rspec/spec/integration/comment_integration_spec.rb +11 -3
  24. data/testing/rspec/spec/integration/directory_integration_spec.rb +2 -2
  25. data/testing/rspec/spec/integration/doc_string_integration_spec.rb +26 -18
  26. data/testing/rspec/spec/integration/example_integration_spec.rb +75 -61
  27. data/testing/rspec/spec/integration/feature_file_integration_spec.rb +30 -20
  28. data/testing/rspec/spec/integration/feature_integration_spec.rb +106 -98
  29. data/testing/rspec/spec/integration/gherkin_2_adapter_spec.rb +11 -11
  30. data/testing/rspec/spec/integration/gherkin_3_adapter_spec.rb +11 -11
  31. data/testing/rspec/spec/integration/gherkin_4_adapter_spec.rb +12 -12
  32. data/testing/rspec/spec/integration/gherkin_6_adapter_spec.rb +166 -0
  33. data/testing/rspec/spec/integration/outline_integration_spec.rb +116 -102
  34. data/testing/rspec/spec/integration/parsing_integration_spec.rb +16 -4
  35. data/testing/rspec/spec/integration/row_integration_spec.rb +26 -18
  36. data/testing/rspec/spec/integration/scenario_integration_spec.rb +82 -74
  37. data/testing/rspec/spec/integration/step_integration_spec.rb +65 -49
  38. data/testing/rspec/spec/integration/table_integration_spec.rb +25 -17
  39. data/testing/rspec/spec/integration/tag_integration_spec.rb +27 -19
  40. data/testing/rspec/spec/spec_helper.rb +64 -35
  41. data/todo.txt +3 -1
  42. metadata +10 -8
  43. data/testing/cucumber/support/transforms.rb +0 -3
@@ -15,7 +15,7 @@ describe 'Step, Integration' do
15
15
  describe 'unique behavior' do
16
16
 
17
17
  it 'can be instantiated with the minimum viable Gherkin' do
18
- source = "#{@step_keyword} a step"
18
+ source = "#{STEP_KEYWORD} a step"
19
19
 
20
20
  expect { clazz.new(source) }.to_not raise_error
21
21
  end
@@ -43,16 +43,32 @@ describe 'Step, Integration' do
43
43
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_step\.feature'/)
44
44
  end
45
45
 
46
- it 'stores the original data generated by the parsing adapter (with a table)', :gherkin4 => true do
47
- step = clazz.new("#{@step_keyword} test step\n|table|")
46
+ it 'stores the original data generated by the parsing adapter (with a table)', :gherkin6 => true do
47
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
48
+ data = step.parsing_data
49
+
50
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
51
+ expect(data[:text]).to eq('test step')
52
+ end
53
+
54
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin6 => true do
55
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
56
+ data = step.parsing_data
57
+
58
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
59
+ expect(data[:text]).to eq('test step')
60
+ end
61
+
62
+ it 'stores the original data generated by the parsing adapter (with a table)', :gherkin4_5 => true do
63
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
48
64
  data = step.parsing_data
49
65
 
50
66
  expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
51
67
  expect(data[:type]).to eq(:Step)
52
68
  end
53
69
 
54
- it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin4 => true do
55
- step = clazz.new("#{@step_keyword} test step\n\"\"\"\na doc string\n\"\"\"")
70
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin4_5 => true do
71
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
56
72
  data = step.parsing_data
57
73
 
58
74
  expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
@@ -60,7 +76,7 @@ describe 'Step, Integration' do
60
76
  end
61
77
 
62
78
  it 'stores the original data generated by the parsing adapter (with a table)', :gherkin3 => true do
63
- step = clazz.new("#{@step_keyword} test step\n|table|")
79
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
64
80
  data = step.parsing_data
65
81
 
66
82
  expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
@@ -68,7 +84,7 @@ describe 'Step, Integration' do
68
84
  end
69
85
 
70
86
  it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin3 => true do
71
- step = clazz.new("#{@step_keyword} test step\n\"\"\"\na doc string\n\"\"\"")
87
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
72
88
  data = step.parsing_data
73
89
 
74
90
  expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
@@ -76,31 +92,31 @@ describe 'Step, Integration' do
76
92
  end
77
93
 
78
94
  it 'stores the original data generated by the parsing adapter (with a table)', :gherkin2 => true do
79
- step = clazz.new("#{@step_keyword} test step\n|table|")
95
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
80
96
  data = step.parsing_data
81
97
 
82
98
  expect(data.keys).to match_array(['keyword', 'name', 'line', 'rows'])
83
- expect(data['keyword']).to eq("#{@step_keyword} ")
99
+ expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
84
100
  end
85
101
 
86
102
  it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin2 => true do
87
- step = clazz.new("#{@step_keyword} test step\n\"\"\"\na doc string\n\"\"\"")
103
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
88
104
  data = step.parsing_data
89
105
 
90
106
  expect(data.keys).to match_array(['keyword', 'name', 'line', 'doc_string'])
91
- expect(data['keyword']).to eq("#{@step_keyword} ")
107
+ expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
92
108
  end
93
109
 
94
110
  describe 'model population' do
95
111
 
96
112
  context 'from source text' do
97
113
 
98
- let(:source_text) { "#{@step_keyword} a step" }
114
+ let(:source_text) { "#{STEP_KEYWORD} a step" }
99
115
  let(:step) { clazz.new(source_text) }
100
116
 
101
117
 
102
118
  it "models the step's keyword" do
103
- expect(step.keyword).to eq("#{@step_keyword}")
119
+ expect(step.keyword).to eq("#{STEP_KEYWORD}")
104
120
  end
105
121
 
106
122
  it "models the step's text" do
@@ -108,10 +124,10 @@ describe 'Step, Integration' do
108
124
  end
109
125
 
110
126
  it "models the step's source line" do
111
- source_text = "#{@feature_keyword}:
127
+ source_text = "#{FEATURE_KEYWORD}:
112
128
 
113
- #{@scenario_keyword}: foo
114
- #{@step_keyword} step"
129
+ #{SCENARIO_KEYWORD}: foo
130
+ #{STEP_KEYWORD} step"
115
131
  step = CukeModeler::Feature.new(source_text).tests.first.steps.first
116
132
 
117
133
  expect(step.source_line).to eq(4)
@@ -120,7 +136,7 @@ describe 'Step, Integration' do
120
136
 
121
137
  context 'with no block' do
122
138
 
123
- let(:source_text) { "#{@step_keyword} a step" }
139
+ let(:source_text) { "#{STEP_KEYWORD} a step" }
124
140
  let(:step) { clazz.new(source_text) }
125
141
 
126
142
 
@@ -132,7 +148,7 @@ describe 'Step, Integration' do
132
148
 
133
149
  context 'a step with a table' do
134
150
 
135
- let(:source_text) { "#{@step_keyword} a step
151
+ let(:source_text) { "#{STEP_KEYWORD} a step
136
152
  | value 1 |
137
153
  | value 2 |" }
138
154
  let(:step) { clazz.new(source_text) }
@@ -148,7 +164,7 @@ describe 'Step, Integration' do
148
164
 
149
165
  context 'a step with a doc string' do
150
166
 
151
- let(:source_text) { "#{@step_keyword} a step
167
+ let(:source_text) { "#{STEP_KEYWORD} a step
152
168
  \"\"\"
153
169
  some text
154
170
  \"\"\"" }
@@ -169,11 +185,11 @@ describe 'Step, Integration' do
169
185
 
170
186
 
171
187
  it 'properly sets its child models' do
172
- source_1 = "#{@step_keyword} a step
188
+ source_1 = "#{STEP_KEYWORD} a step
173
189
  \"\"\"
174
190
  a doc string
175
191
  \"\"\""
176
- source_2 = "#{@step_keyword} a step
192
+ source_2 = "#{STEP_KEYWORD} a step
177
193
  | a block|"
178
194
 
179
195
  step_1 = clazz.new(source_1)
@@ -191,9 +207,9 @@ describe 'Step, Integration' do
191
207
  describe 'step comparison' do
192
208
 
193
209
  it 'is equal to another Step that has the same text' do
194
- source_1 = "#{@step_keyword} a step"
195
- source_2 = "#{@step_keyword} a step"
196
- source_3 = "#{@step_keyword} a different step"
210
+ source_1 = "#{STEP_KEYWORD} a step"
211
+ source_2 = "#{STEP_KEYWORD} a step"
212
+ source_3 = "#{STEP_KEYWORD} a different step"
197
213
 
198
214
  step_1 = clazz.new(source_1)
199
215
  step_2 = clazz.new(source_2)
@@ -205,8 +221,8 @@ describe 'Step, Integration' do
205
221
  end
206
222
 
207
223
  it 'ignores steps keywords when comparing steps' do
208
- source_1 = "#{@given_keyword} a step"
209
- source_2 = "#{@then_keyword} a step"
224
+ source_1 = "#{GIVEN_KEYWORD} a step"
225
+ source_2 = "#{THEN_KEYWORD} a step"
210
226
 
211
227
  step_1 = clazz.new(source_1)
212
228
  step_2 = clazz.new(source_2)
@@ -216,8 +232,8 @@ describe 'Step, Integration' do
216
232
  end
217
233
 
218
234
  it 'ignores step tables when comparing steps' do
219
- source_1 = "#{@step_keyword} a step"
220
- source_2 = "#{@step_keyword} a step\n|with a table|"
235
+ source_1 = "#{STEP_KEYWORD} a step"
236
+ source_2 = "#{STEP_KEYWORD} a step\n|with a table|"
221
237
 
222
238
  step_1 = clazz.new(source_1)
223
239
  step_2 = clazz.new(source_2)
@@ -227,8 +243,8 @@ describe 'Step, Integration' do
227
243
  end
228
244
 
229
245
  it 'ignores step doc strings when comparing steps' do
230
- source_1 = "#{@step_keyword} a step"
231
- source_2 = "#{@step_keyword} a step\n\"\"\"\nwith a doc string\n\"\"\""
246
+ source_1 = "#{STEP_KEYWORD} a step"
247
+ source_2 = "#{STEP_KEYWORD} a step\n\"\"\"\nwith a doc string\n\"\"\""
232
248
 
233
249
 
234
250
  step_1 = clazz.new(source_1)
@@ -249,10 +265,10 @@ describe 'Step, Integration' do
249
265
 
250
266
 
251
267
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
252
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
268
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
253
269
 
254
- #{@scenario_keyword}: Test test
255
- #{@step_keyword} a step:"
270
+ #{SCENARIO_KEYWORD}: Test test
271
+ #{STEP_KEYWORD} a step:"
256
272
  }
257
273
 
258
274
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -281,10 +297,10 @@ describe 'Step, Integration' do
281
297
  context 'a step that is part of a scenario' do
282
298
 
283
299
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
284
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
300
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
285
301
 
286
- #{@scenario_keyword}: Test scenario
287
- #{@step_keyword} a step"
302
+ #{SCENARIO_KEYWORD}: Test scenario
303
+ #{STEP_KEYWORD} a step"
288
304
  }
289
305
 
290
306
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -302,11 +318,11 @@ describe 'Step, Integration' do
302
318
  context 'a step that is part of an outline' do
303
319
 
304
320
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
305
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
321
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
306
322
 
307
- #{@outline_keyword}: Test outline
308
- #{@step_keyword} a step
309
- #{@example_keyword}:
323
+ #{OUTLINE_KEYWORD}: Test outline
324
+ #{STEP_KEYWORD} a step
325
+ #{EXAMPLE_KEYWORD}:
310
326
  | param |
311
327
  | value |"
312
328
  }
@@ -326,10 +342,10 @@ describe 'Step, Integration' do
326
342
  context 'a step that is part of a background' do
327
343
 
328
344
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
329
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
345
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
330
346
 
331
- #{@background_keyword}: Test background
332
- #{@step_keyword} a step"
347
+ #{BACKGROUND_KEYWORD}: Test background
348
+ #{STEP_KEYWORD} a step"
333
349
  }
334
350
 
335
351
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -359,13 +375,13 @@ describe 'Step, Integration' do
359
375
 
360
376
  context 'with no block' do
361
377
 
362
- let(:source_text) { ["#{@step_keyword} a step"].join("\n") }
378
+ let(:source_text) { ["#{STEP_KEYWORD} a step"].join("\n") }
363
379
  let(:step) { clazz.new(source_text) }
364
380
 
365
381
  it 'can output a step' do
366
382
  step_output = step.to_s.split("\n", -1)
367
383
 
368
- expect(step_output).to eq(["#{@step_keyword} a step"])
384
+ expect(step_output).to eq(["#{STEP_KEYWORD} a step"])
369
385
  end
370
386
 
371
387
  it 'can be remade from its own output' do
@@ -379,7 +395,7 @@ describe 'Step, Integration' do
379
395
 
380
396
  context 'a step with a table' do
381
397
 
382
- let(:source_text) { ["#{@step_keyword} a step",
398
+ let(:source_text) { ["#{STEP_KEYWORD} a step",
383
399
  ' | value1 | value2 |',
384
400
  ' | value3 | value4 |'].join("\n") }
385
401
  let(:step) { clazz.new(source_text) }
@@ -388,7 +404,7 @@ describe 'Step, Integration' do
388
404
  it 'can output a step that has a table' do
389
405
  step_output = step.to_s.split("\n", -1)
390
406
 
391
- expect(step_output).to eq(["#{@step_keyword} a step",
407
+ expect(step_output).to eq(["#{STEP_KEYWORD} a step",
392
408
  ' | value1 | value2 |',
393
409
  ' | value3 | value4 |'])
394
410
 
@@ -405,7 +421,7 @@ describe 'Step, Integration' do
405
421
 
406
422
  context 'a step with a doc string' do
407
423
 
408
- let(:source_text) { ["#{@step_keyword} a step",
424
+ let(:source_text) { ["#{STEP_KEYWORD} a step",
409
425
  ' """',
410
426
  ' some text',
411
427
  ' """'].join("\n") }
@@ -415,7 +431,7 @@ describe 'Step, Integration' do
415
431
  it 'can output a step that has a doc string' do
416
432
  step_output = step.to_s.split("\n", -1)
417
433
 
418
- expect(step_output).to eq(["#{@step_keyword} a step",
434
+ expect(step_output).to eq(["#{STEP_KEYWORD} a step",
419
435
  ' """',
420
436
  ' some text',
421
437
  ' """'])
@@ -21,7 +21,15 @@ describe 'Table, Integration' do
21
21
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_table\.feature'/)
22
22
  end
23
23
 
24
- it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
24
+ it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
25
+ table = clazz.new("| a table |")
26
+ data = table.parsing_data
27
+
28
+ expect(data.keys).to match_array([:location, :rows])
29
+ expect(data[:location][:line]).to eq(5)
30
+ end
31
+
32
+ it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
25
33
  table = clazz.new("| a table |")
26
34
  data = table.parsing_data
27
35
 
@@ -74,10 +82,10 @@ describe 'Table, Integration' do
74
82
  context 'from source text' do
75
83
 
76
84
  it "models the table's source line" do
77
- source_text = "#{@feature_keyword}:
85
+ source_text = "#{FEATURE_KEYWORD}:
78
86
 
79
- #{@scenario_keyword}:
80
- #{@step_keyword} step
87
+ #{SCENARIO_KEYWORD}:
88
+ #{STEP_KEYWORD} step
81
89
  | value |"
82
90
  table = CukeModeler::Feature.new(source_text).tests.first.steps.first.block
83
91
 
@@ -125,10 +133,10 @@ describe 'Table, Integration' do
125
133
 
126
134
 
127
135
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
128
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
136
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
129
137
 
130
- #{@scenario_keyword}: Test test
131
- #{@step_keyword} a step:
138
+ #{SCENARIO_KEYWORD}: Test test
139
+ #{STEP_KEYWORD} a step:
132
140
  | a | table |"
133
141
  }
134
142
 
@@ -157,10 +165,10 @@ describe 'Table, Integration' do
157
165
  context 'a table that is part of a scenario' do
158
166
 
159
167
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
160
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
168
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
161
169
 
162
- #{@scenario_keyword}: Test test
163
- #{@step_keyword} a step:
170
+ #{SCENARIO_KEYWORD}: Test test
171
+ #{STEP_KEYWORD} a step:
164
172
  | a | table |"
165
173
  }
166
174
 
@@ -179,12 +187,12 @@ describe 'Table, Integration' do
179
187
  context 'a table that is part of an outline' do
180
188
 
181
189
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
182
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
190
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
183
191
 
184
- #{@outline_keyword}: Test outline
185
- #{@step_keyword} a step:
192
+ #{OUTLINE_KEYWORD}: Test outline
193
+ #{STEP_KEYWORD} a step:
186
194
  | a | table |
187
- #{@example_keyword}:
195
+ #{EXAMPLE_KEYWORD}:
188
196
  | param |
189
197
  | value |"
190
198
  }
@@ -204,10 +212,10 @@ describe 'Table, Integration' do
204
212
  context 'a table that is part of a background' do
205
213
 
206
214
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
207
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
215
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
208
216
 
209
- #{@background_keyword}: Test background
210
- #{@step_keyword} a step:
217
+ #{BACKGROUND_KEYWORD}: Test background
218
+ #{STEP_KEYWORD} a step:
211
219
  | a | table |"
212
220
  }
213
221
 
@@ -43,7 +43,15 @@ describe 'Tag, Integration' do
43
43
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_tag\.feature'/)
44
44
  end
45
45
 
46
- it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
46
+ it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
47
+ tag = clazz.new('@a_tag')
48
+ data = tag.parsing_data
49
+
50
+ expect(data.keys).to match_array([:location, :name])
51
+ expect(data[:name]).to eq('@a_tag')
52
+ end
53
+
54
+ it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
47
55
  tag = clazz.new('@a_tag')
48
56
  data = tag.parsing_data
49
57
 
@@ -77,13 +85,13 @@ describe 'Tag, Integration' do
77
85
 
78
86
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
79
87
  let(:source_gherkin) { "@feature_tag
80
- #{@feature_keyword}: Test feature
88
+ #{FEATURE_KEYWORD}: Test feature
81
89
 
82
- #{@outline_keyword}: Test test
83
- #{@step_keyword} a step
90
+ #{OUTLINE_KEYWORD}: Test test
91
+ #{STEP_KEYWORD} a step
84
92
 
85
93
  @example_tag
86
- #{@example_keyword}: Test example
94
+ #{EXAMPLE_KEYWORD}: Test example
87
95
  | a param |
88
96
  | a value |"
89
97
  }
@@ -114,11 +122,11 @@ describe 'Tag, Integration' do
114
122
  context 'a tag that is part of a scenario' do
115
123
 
116
124
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
117
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
125
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
118
126
 
119
127
  @a_tag
120
- #{@scenario_keyword}: Test scenario
121
- #{@step_keyword} a step"
128
+ #{SCENARIO_KEYWORD}: Test scenario
129
+ #{STEP_KEYWORD} a step"
122
130
  }
123
131
 
124
132
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -136,12 +144,12 @@ describe 'Tag, Integration' do
136
144
  context 'a tag that is part of an outline' do
137
145
 
138
146
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
139
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
147
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
140
148
 
141
149
  @a_tag
142
- #{@outline_keyword}: Test outline
143
- #{@step_keyword} a step
144
- #{@example_keyword}:
150
+ #{OUTLINE_KEYWORD}: Test outline
151
+ #{STEP_KEYWORD} a step
152
+ #{EXAMPLE_KEYWORD}:
145
153
  | param |
146
154
  | value |"
147
155
  }
@@ -161,12 +169,12 @@ describe 'Tag, Integration' do
161
169
  context 'a tag that is part of an example' do
162
170
 
163
171
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
164
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
172
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
165
173
 
166
- #{@outline_keyword}: Test outline
167
- #{@step_keyword} a step
174
+ #{OUTLINE_KEYWORD}: Test outline
175
+ #{STEP_KEYWORD} a step
168
176
  @a_tag
169
- #{@example_keyword}:
177
+ #{EXAMPLE_KEYWORD}:
170
178
  | param |
171
179
  | value |"
172
180
  }
@@ -205,11 +213,11 @@ describe 'Tag, Integration' do
205
213
  end
206
214
 
207
215
  it "models the tag's source line" do
208
- source_text = "#{@feature_keyword}:
216
+ source_text = "#{FEATURE_KEYWORD}:
209
217
 
210
218
  @a_tag
211
- #{@scenario_keyword}:
212
- #{@step_keyword} step"
219
+ #{SCENARIO_KEYWORD}:
220
+ #{STEP_KEYWORD} step"
213
221
  tag = CukeModeler::Feature.new(source_text).tests.first.tags.first
214
222
 
215
223
  expect(tag.source_line).to eq(3)