cuke_modeler 1.3.0 → 1.4.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 (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
@@ -8,7 +8,15 @@ describe 'Parsing, Integration' do
8
8
 
9
9
  describe 'unique behavior' do
10
10
 
11
- it 'loads the correct dialects based on the version of Gherkin used', :gherkin3 => true, :gherkin4 => true do
11
+ it 'will complain if using an unknown version of `gherkin`' do
12
+ skip('finish me')
13
+ end
14
+
15
+ it 'loads the correct dialects based on the version of Gherkin used', :gherkin6 => true do
16
+ expect(nodule.dialects).to equal(Gherkin::DIALECTS)
17
+ end
18
+
19
+ it 'loads the correct dialects based on the version of Gherkin used', :gherkin3 => true, :gherkin4_5 => true do
12
20
  expect(nodule.dialects).to equal(Gherkin::DIALECTS)
13
21
  end
14
22
 
@@ -39,7 +47,7 @@ describe 'Parsing, Integration' do
39
47
 
40
48
  it 'raises and error if given something to parse besides a string' do
41
49
  expect { nodule.parse_text(5) }.to raise_error(ArgumentError, /Text to parse must be a String but got/)
42
- expect { nodule.parse_text("#{@feature_keyword}:") }.to_not raise_error
50
+ expect { nodule.parse_text("#{FEATURE_KEYWORD}:") }.to_not raise_error
43
51
  end
44
52
 
45
53
  it 'includes the type of object provided when raising an non-string exception' do
@@ -48,11 +56,11 @@ describe 'Parsing, Integration' do
48
56
 
49
57
  # todo - Stop doing this. Just return a feature file rooted AST. (Will require major version number change)
50
58
  it 'returns an Array' do
51
- result = nodule.parse_text("#{@feature_keyword}:")
59
+ result = nodule.parse_text("#{FEATURE_KEYWORD}:")
52
60
  expect(result).to be_a(Array)
53
61
  end
54
62
 
55
- it 'raises and error if an error is encountered while parsing text' do
63
+ it 'raises an error if an error is encountered while parsing text' do
56
64
  expect { nodule.parse_text('bad file') }.to raise_error(ArgumentError, /Error encountered while parsing '.*'/)
57
65
  end
58
66
 
@@ -100,6 +108,10 @@ describe 'Parsing, Integration' do
100
108
  expect { nodule.parse_text('bad file') }.to raise_error(ArgumentError, /'cuke_modeler_fake_file\.feature'/)
101
109
  end
102
110
 
111
+ it 'uses the given file name if one is provided' do
112
+ skip('finish me')
113
+ end
114
+
103
115
  end
104
116
 
105
117
  end
@@ -44,7 +44,15 @@ describe 'Row, Integration' do
44
44
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_row\.feature'/)
45
45
  end
46
46
 
47
- it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
47
+ it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
48
+ example_row = clazz.new("| a | row |")
49
+ data = example_row.parsing_data
50
+
51
+ expect(data.keys).to match_array([:location, :cells])
52
+ expect(data[:location][:line]).to eq(5)
53
+ end
54
+
55
+ it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
48
56
  example_row = clazz.new("| a | row |")
49
57
  data = example_row.parsing_data
50
58
 
@@ -88,10 +96,10 @@ describe 'Row, Integration' do
88
96
 
89
97
 
90
98
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
91
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
99
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
92
100
 
93
- #{@scenario_keyword}: Test test
94
- #{@step_keyword} a step:
101
+ #{SCENARIO_KEYWORD}: Test test
102
+ #{STEP_KEYWORD} a step:
95
103
  | a | table |"
96
104
  }
97
105
 
@@ -132,10 +140,10 @@ describe 'Row, Integration' do
132
140
  context 'a row that is part of a scenario' do
133
141
 
134
142
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
135
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
143
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
136
144
 
137
- #{@scenario_keyword}: Test test
138
- #{@step_keyword} a step:
145
+ #{SCENARIO_KEYWORD}: Test test
146
+ #{STEP_KEYWORD} a step:
139
147
  | a | table |"
140
148
  }
141
149
 
@@ -155,10 +163,10 @@ describe 'Row, Integration' do
155
163
  context 'a row that is part of a background' do
156
164
 
157
165
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
158
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
166
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
159
167
 
160
- #{@background_keyword}: Test background
161
- #{@step_keyword} a step:
168
+ #{BACKGROUND_KEYWORD}: Test background
169
+ #{STEP_KEYWORD} a step:
162
170
  | a | table |"
163
171
  }
164
172
 
@@ -177,11 +185,11 @@ describe 'Row, Integration' do
177
185
  context 'a row that is part of an outline' do
178
186
 
179
187
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
180
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
188
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
181
189
 
182
- #{@outline_keyword}: Test outline
183
- #{@step_keyword} a step
184
- #{@example_keyword}:
190
+ #{OUTLINE_KEYWORD}: Test outline
191
+ #{STEP_KEYWORD} a step
192
+ #{EXAMPLE_KEYWORD}:
185
193
  | param |
186
194
  | value |"
187
195
  }
@@ -228,11 +236,11 @@ describe 'Row, Integration' do
228
236
  end
229
237
 
230
238
  it "models the row's source line" do
231
- source_text = "#{@feature_keyword}: Test feature
239
+ source_text = "#{FEATURE_KEYWORD}: Test feature
232
240
 
233
- #{@outline_keyword}: Test outline
234
- #{@step_keyword} a step
235
- #{@example_keyword}:
241
+ #{OUTLINE_KEYWORD}: Test outline
242
+ #{STEP_KEYWORD} a step
243
+ #{EXAMPLE_KEYWORD}:
236
244
  | param |
237
245
  | value |"
238
246
  row = CukeModeler::Feature.new(source_text).tests.first.examples.first.rows.first
@@ -15,7 +15,7 @@ describe 'Scenario, Integration' do
15
15
  describe 'unique behavior' do
16
16
 
17
17
  it 'can be instantiated with the minimum viable Gherkin' do
18
- source = "#{@scenario_keyword}:"
18
+ source = "#{SCENARIO_KEYWORD}:"
19
19
 
20
20
  expect { clazz.new(source) }.to_not raise_error
21
21
  end
@@ -38,13 +38,21 @@ describe 'Scenario, Integration' do
38
38
  end
39
39
 
40
40
  it 'provides a descriptive filename when being parsed from stand alone text' do
41
- source = "bad scenario text \n #{@scenario_keyword}:\n And a step\n @foo "
41
+ source = "bad scenario text \n #{SCENARIO_KEYWORD}:\n And a step\n @foo "
42
42
 
43
43
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_scenario\.feature'/)
44
44
  end
45
45
 
46
- it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
47
- scenario = clazz.new("@tag\n#{@scenario_keyword}: test scenario\ndescription\n#{@step_keyword} a step")
46
+ it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
47
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
48
+ data = scenario.parsing_data
49
+
50
+ expect(data.keys).to match_array([:background, :rule, :scenario])
51
+ expect(data[:scenario][:name]).to eq('test scenario')
52
+ end
53
+
54
+ it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
55
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
48
56
  data = scenario.parsing_data
49
57
 
50
58
  expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
@@ -52,7 +60,7 @@ describe 'Scenario, Integration' do
52
60
  end
53
61
 
54
62
  it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
55
- scenario = clazz.new("@tag\n#{@scenario_keyword}: test scenario\ndescription\n#{@step_keyword} a step")
63
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
56
64
  data = scenario.parsing_data
57
65
 
58
66
  expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
@@ -60,7 +68,7 @@ describe 'Scenario, Integration' do
60
68
  end
61
69
 
62
70
  it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
63
- scenario = clazz.new("@tag\n#{@scenario_keyword}: test scenario\ndescription\n#{@step_keyword} a step")
71
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
64
72
  data = scenario.parsing_data
65
73
 
66
74
  expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'steps', 'tags'])
@@ -69,8 +77,8 @@ describe 'Scenario, Integration' do
69
77
 
70
78
  it 'properly sets its child models' do
71
79
  source = "@a_tag
72
- #{@scenario_keyword}: Test scenario
73
- #{@step_keyword} a step"
80
+ #{SCENARIO_KEYWORD}: Test scenario
81
+ #{STEP_KEYWORD} a step"
74
82
 
75
83
  scenario = clazz.new(source)
76
84
  step = scenario.steps.first
@@ -81,7 +89,7 @@ describe 'Scenario, Integration' do
81
89
  end
82
90
 
83
91
  it 'trims whitespace from its source description' do
84
- source = ["#{@scenario_keyword}:",
92
+ source = ["#{SCENARIO_KEYWORD}:",
85
93
  ' ',
86
94
  ' description line 1',
87
95
  '',
@@ -90,7 +98,7 @@ describe 'Scenario, Integration' do
90
98
  '',
91
99
  '',
92
100
  '',
93
- " #{@step_keyword} a step"]
101
+ " #{STEP_KEYWORD} a step"]
94
102
  source = source.join("\n")
95
103
 
96
104
  scenario = clazz.new(source)
@@ -111,10 +119,10 @@ describe 'Scenario, Integration' do
111
119
 
112
120
 
113
121
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
114
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
122
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
115
123
 
116
- #{@scenario_keyword}: Test test
117
- #{@step_keyword} a step"
124
+ #{SCENARIO_KEYWORD}: Test test
125
+ #{STEP_KEYWORD} a step"
118
126
  }
119
127
 
120
128
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -152,19 +160,19 @@ describe 'Scenario, Integration' do
152
160
 
153
161
  context 'from source text' do
154
162
 
155
- let(:source_text) { "#{@scenario_keyword}:" }
163
+ let(:source_text) { "#{SCENARIO_KEYWORD}:" }
156
164
  let(:scenario) { clazz.new(source_text) }
157
165
 
158
166
 
159
167
  it "models the scenario's keyword" do
160
- expect(scenario.keyword).to eq("#{@scenario_keyword}")
168
+ expect(scenario.keyword).to eq("#{SCENARIO_KEYWORD}")
161
169
  end
162
170
 
163
171
  it "models the scenario's source line" do
164
- source_text = "#{@feature_keyword}:
172
+ source_text = "#{FEATURE_KEYWORD}:
165
173
 
166
- #{@scenario_keyword}: foo
167
- #{@step_keyword} step"
174
+ #{SCENARIO_KEYWORD}: foo
175
+ #{STEP_KEYWORD} step"
168
176
  scenario = CukeModeler::Feature.new(source_text).tests.first
169
177
 
170
178
  expect(scenario.source_line).to eq(3)
@@ -174,15 +182,15 @@ describe 'Scenario, Integration' do
174
182
  context 'a filled scenario' do
175
183
 
176
184
  let(:source_text) { "@tag1 @tag2 @tag3
177
- #{@scenario_keyword}: Scenario name
185
+ #{SCENARIO_KEYWORD}: Scenario name
178
186
 
179
187
  Scenario description.
180
188
 
181
189
  Some more.
182
190
  Even more.
183
191
 
184
- #{@step_keyword} a step
185
- #{@step_keyword} another step" }
192
+ #{STEP_KEYWORD} a step
193
+ #{STEP_KEYWORD} another step" }
186
194
  let(:scenario) { clazz.new(source_text) }
187
195
 
188
196
 
@@ -215,7 +223,7 @@ describe 'Scenario, Integration' do
215
223
 
216
224
  context 'an empty scenario' do
217
225
 
218
- let(:source_text) { "#{@scenario_keyword}:" }
226
+ let(:source_text) { "#{SCENARIO_KEYWORD}:" }
219
227
  let(:scenario) { clazz.new(source_text) }
220
228
 
221
229
 
@@ -245,19 +253,19 @@ describe 'Scenario, Integration' do
245
253
  describe 'comparison' do
246
254
 
247
255
  it 'is equal to a background with the same steps' do
248
- source = "#{@scenario_keyword}:
249
- #{@step_keyword} step 1
250
- #{@step_keyword} step 2"
256
+ source = "#{SCENARIO_KEYWORD}:
257
+ #{STEP_KEYWORD} step 1
258
+ #{STEP_KEYWORD} step 2"
251
259
  scenario = clazz.new(source)
252
260
 
253
- source = "#{@background_keyword}:
254
- #{@step_keyword} step 1
255
- #{@step_keyword} step 2"
261
+ source = "#{BACKGROUND_KEYWORD}:
262
+ #{STEP_KEYWORD} step 1
263
+ #{STEP_KEYWORD} step 2"
256
264
  background_1 = CukeModeler::Background.new(source)
257
265
 
258
- source = "#{@background_keyword}:
259
- #{@step_keyword} step 2
260
- #{@step_keyword} step 1"
266
+ source = "#{BACKGROUND_KEYWORD}:
267
+ #{STEP_KEYWORD} step 2
268
+ #{STEP_KEYWORD} step 1"
261
269
  background_2 = CukeModeler::Background.new(source)
262
270
 
263
271
 
@@ -266,19 +274,19 @@ describe 'Scenario, Integration' do
266
274
  end
267
275
 
268
276
  it 'is equal to a scenario with the same steps' do
269
- source = "#{@scenario_keyword}:
270
- #{@step_keyword} step 1
271
- #{@step_keyword} step 2"
277
+ source = "#{SCENARIO_KEYWORD}:
278
+ #{STEP_KEYWORD} step 1
279
+ #{STEP_KEYWORD} step 2"
272
280
  scenario_1 = clazz.new(source)
273
281
 
274
- source = "#{@scenario_keyword}:
275
- #{@step_keyword} step 1
276
- #{@step_keyword} step 2"
282
+ source = "#{SCENARIO_KEYWORD}:
283
+ #{STEP_KEYWORD} step 1
284
+ #{STEP_KEYWORD} step 2"
277
285
  scenario_2 = clazz.new(source)
278
286
 
279
- source = "#{@scenario_keyword}:
280
- #{@step_keyword} step 2
281
- #{@step_keyword} step 1"
287
+ source = "#{SCENARIO_KEYWORD}:
288
+ #{STEP_KEYWORD} step 2
289
+ #{STEP_KEYWORD} step 1"
282
290
  scenario_3 = clazz.new(source)
283
291
 
284
292
 
@@ -287,23 +295,23 @@ describe 'Scenario, Integration' do
287
295
  end
288
296
 
289
297
  it 'is equal to an outline with the same steps' do
290
- source = "#{@scenario_keyword}:
291
- #{@step_keyword} step 1
292
- #{@step_keyword} step 2"
298
+ source = "#{SCENARIO_KEYWORD}:
299
+ #{STEP_KEYWORD} step 1
300
+ #{STEP_KEYWORD} step 2"
293
301
  scenario = clazz.new(source)
294
302
 
295
- source = "#{@outline_keyword}:
296
- #{@step_keyword} step 1
297
- #{@step_keyword} step 2
298
- #{@example_keyword}:
303
+ source = "#{OUTLINE_KEYWORD}:
304
+ #{STEP_KEYWORD} step 1
305
+ #{STEP_KEYWORD} step 2
306
+ #{EXAMPLE_KEYWORD}:
299
307
  | param |
300
308
  | value |"
301
309
  outline_1 = CukeModeler::Outline.new(source)
302
310
 
303
- source = "#{@outline_keyword}:
304
- #{@step_keyword} step 2
305
- #{@step_keyword} step 1
306
- #{@example_keyword}:
311
+ source = "#{OUTLINE_KEYWORD}:
312
+ #{STEP_KEYWORD} step 2
313
+ #{STEP_KEYWORD} step 1
314
+ #{EXAMPLE_KEYWORD}:
307
315
  | param |
308
316
  | value |"
309
317
  outline_2 = CukeModeler::Outline.new(source)
@@ -320,14 +328,14 @@ describe 'Scenario, Integration' do
320
328
 
321
329
  it 'can be remade from its own output' do
322
330
  source = "@tag1 @tag2 @tag3
323
- #{@scenario_keyword}: A scenario with everything it could have
331
+ #{SCENARIO_KEYWORD}: A scenario with everything it could have
324
332
 
325
333
  Including a description
326
334
  and then some.
327
335
 
328
- #{@step_keyword} a step
336
+ #{STEP_KEYWORD} a step
329
337
  | value |
330
- #{@step_keyword} another step
338
+ #{STEP_KEYWORD} another step
331
339
  \"\"\"
332
340
  some string
333
341
  \"\"\""
@@ -343,27 +351,27 @@ describe 'Scenario, Integration' do
343
351
  context 'from source text' do
344
352
 
345
353
  it 'can output an empty scenario' do
346
- source = ["#{@scenario_keyword}:"]
354
+ source = ["#{SCENARIO_KEYWORD}:"]
347
355
  source = source.join("\n")
348
356
  scenario = clazz.new(source)
349
357
 
350
358
  scenario_output = scenario.to_s.split("\n", -1)
351
359
 
352
- expect(scenario_output).to eq(["#{@scenario_keyword}:"])
360
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:"])
353
361
  end
354
362
 
355
363
  it 'can output a scenario that has a name' do
356
- source = ["#{@scenario_keyword}: test scenario"]
364
+ source = ["#{SCENARIO_KEYWORD}: test scenario"]
357
365
  source = source.join("\n")
358
366
  scenario = clazz.new(source)
359
367
 
360
368
  scenario_output = scenario.to_s.split("\n", -1)
361
369
 
362
- expect(scenario_output).to eq(["#{@scenario_keyword}: test scenario"])
370
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}: test scenario"])
363
371
  end
364
372
 
365
373
  it 'can output a scenario that has a description' do
366
- source = ["#{@scenario_keyword}:",
374
+ source = ["#{SCENARIO_KEYWORD}:",
367
375
  'Some description.',
368
376
  'Some more description.']
369
377
  source = source.join("\n")
@@ -371,17 +379,17 @@ describe 'Scenario, Integration' do
371
379
 
372
380
  scenario_output = scenario.to_s.split("\n", -1)
373
381
 
374
- expect(scenario_output).to eq(["#{@scenario_keyword}:",
382
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:",
375
383
  '',
376
384
  'Some description.',
377
385
  'Some more description.'])
378
386
  end
379
387
 
380
388
  it 'can output a scenario that has steps' do
381
- source = ["#{@scenario_keyword}:",
382
- "#{@step_keyword} a step",
389
+ source = ["#{SCENARIO_KEYWORD}:",
390
+ "#{STEP_KEYWORD} a step",
383
391
  '|value|',
384
- "#{@step_keyword} another step",
392
+ "#{STEP_KEYWORD} another step",
385
393
  '"""',
386
394
  'some string',
387
395
  '"""']
@@ -390,10 +398,10 @@ describe 'Scenario, Integration' do
390
398
 
391
399
  scenario_output = scenario.to_s.split("\n", -1)
392
400
 
393
- expect(scenario_output).to eq(["#{@scenario_keyword}:",
394
- " #{@step_keyword} a step",
401
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:",
402
+ " #{STEP_KEYWORD} a step",
395
403
  ' | value |',
396
- " #{@step_keyword} another step",
404
+ " #{STEP_KEYWORD} another step",
397
405
  ' """',
398
406
  ' some string',
399
407
  ' """'])
@@ -402,24 +410,24 @@ describe 'Scenario, Integration' do
402
410
  it 'can output a scenario that has tags' do
403
411
  source = ['@tag1 @tag2',
404
412
  '@tag3',
405
- "#{@scenario_keyword}:"]
413
+ "#{SCENARIO_KEYWORD}:"]
406
414
  source = source.join("\n")
407
415
  scenario = clazz.new(source)
408
416
 
409
417
  scenario_output = scenario.to_s.split("\n", -1)
410
418
 
411
419
  expect(scenario_output).to eq(['@tag1 @tag2 @tag3',
412
- "#{@scenario_keyword}:"])
420
+ "#{SCENARIO_KEYWORD}:"])
413
421
  end
414
422
 
415
423
  it 'can output a scenario that has everything' do
416
424
  source = ['@tag1 @tag2 @tag3',
417
- "#{@scenario_keyword}: A scenario with everything it could have",
425
+ "#{SCENARIO_KEYWORD}: A scenario with everything it could have",
418
426
  'Including a description',
419
427
  'and then some.',
420
- "#{@step_keyword} a step",
428
+ "#{STEP_KEYWORD} a step",
421
429
  '|value|',
422
- "#{@step_keyword} another step",
430
+ "#{STEP_KEYWORD} another step",
423
431
  '"""',
424
432
  'some string',
425
433
  '"""']
@@ -429,14 +437,14 @@ describe 'Scenario, Integration' do
429
437
  scenario_output = scenario.to_s.split("\n", -1)
430
438
 
431
439
  expect(scenario_output).to eq(['@tag1 @tag2 @tag3',
432
- "#{@scenario_keyword}: A scenario with everything it could have",
440
+ "#{SCENARIO_KEYWORD}: A scenario with everything it could have",
433
441
  '',
434
442
  'Including a description',
435
443
  'and then some.',
436
444
  '',
437
- " #{@step_keyword} a step",
445
+ " #{STEP_KEYWORD} a step",
438
446
  ' | value |',
439
- " #{@step_keyword} another step",
447
+ " #{STEP_KEYWORD} another step",
440
448
  ' """',
441
449
  ' some string',
442
450
  ' """'])