cuke_modeler 1.3.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +60 -17
  3. data/CHANGELOG.md +312 -0
  4. data/Gemfile +19 -3
  5. data/LICENSE.txt +1 -1
  6. data/README.md +17 -7
  7. data/Rakefile +45 -28
  8. data/appveyor.yml +57 -17
  9. data/cuke_modeler.gemspec +6 -3
  10. data/lib/cuke_modeler/adapters/gherkin_2_adapter.rb +1 -0
  11. data/lib/cuke_modeler/adapters/gherkin_3_adapter.rb +1 -0
  12. data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +2 -1
  13. data/lib/cuke_modeler/adapters/gherkin_5_adapter.rb +12 -0
  14. data/lib/cuke_modeler/adapters/gherkin_6_adapter.rb +310 -0
  15. data/lib/cuke_modeler/adapters/gherkin_7_adapter.rb +307 -0
  16. data/lib/cuke_modeler/adapters/gherkin_8_adapter.rb +12 -0
  17. data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +12 -0
  18. data/lib/cuke_modeler/containing.rb +16 -0
  19. data/lib/cuke_modeler/described.rb +1 -0
  20. data/lib/cuke_modeler/models/step.rb +31 -2
  21. data/lib/cuke_modeler/named.rb +1 -0
  22. data/lib/cuke_modeler/nested.rb +1 -0
  23. data/lib/cuke_modeler/parsed.rb +1 -0
  24. data/lib/cuke_modeler/parsing.rb +116 -68
  25. data/lib/cuke_modeler/sourceable.rb +1 -0
  26. data/lib/cuke_modeler/stepped.rb +1 -0
  27. data/lib/cuke_modeler/taggable.rb +1 -0
  28. data/lib/cuke_modeler/version.rb +1 -1
  29. data/testing/cucumber/features/analysis/step_comparison.feature +25 -0
  30. data/testing/cucumber/features/analysis/test_comparison.feature +1 -1
  31. data/testing/cucumber/step_definitions/feature_file_steps.rb +1 -1
  32. data/testing/cucumber/step_definitions/modeling_steps.rb +7 -2
  33. data/testing/cucumber/step_definitions/verification_steps.rb +11 -2
  34. data/testing/file_helper.rb +3 -0
  35. data/testing/gemfiles/gherkin2.gemfile +8 -0
  36. data/testing/gemfiles/gherkin3.gemfile +6 -0
  37. data/testing/gemfiles/gherkin4.gemfile +7 -0
  38. data/testing/gemfiles/gherkin5.gemfile +7 -0
  39. data/testing/gemfiles/gherkin6.gemfile +10 -0
  40. data/testing/gemfiles/gherkin7.gemfile +9 -0
  41. data/testing/gemfiles/gherkin8.gemfile +9 -0
  42. data/testing/gemfiles/gherkin9.gemfile +9 -0
  43. data/testing/helper_methods.rb +23 -0
  44. data/testing/rspec/spec/integration/{gherkin_2_adapter_spec.rb → adapters/gherkin_2_adapter_spec.rb} +13 -13
  45. data/testing/rspec/spec/integration/{gherkin_3_adapter_spec.rb → adapters/gherkin_3_adapter_spec.rb} +13 -13
  46. data/testing/rspec/spec/integration/{gherkin_4_adapter_spec.rb → adapters/gherkin_4_adapter_spec.rb} +13 -13
  47. data/testing/rspec/spec/integration/adapters/gherkin_5_adapter_spec.rb +165 -0
  48. data/testing/rspec/spec/integration/adapters/gherkin_6_adapter_spec.rb +159 -0
  49. data/testing/rspec/spec/integration/adapters/gherkin_7_adapter_spec.rb +162 -0
  50. data/testing/rspec/spec/integration/adapters/gherkin_8_adapter_spec.rb +162 -0
  51. data/testing/rspec/spec/integration/adapters/gherkin_9_adapter_spec.rb +162 -0
  52. data/testing/rspec/spec/integration/{background_integration_spec.rb → models/background_integration_spec.rb} +90 -86
  53. data/testing/rspec/spec/integration/{cell_integration_spec.rb → models/cell_integration_spec.rb} +49 -38
  54. data/testing/rspec/spec/integration/{comment_integration_spec.rb → models/comment_integration_spec.rb} +31 -20
  55. data/testing/rspec/spec/integration/{directory_integration_spec.rb → models/directory_integration_spec.rb} +3 -3
  56. data/testing/rspec/spec/integration/{doc_string_integration_spec.rb → models/doc_string_integration_spec.rb} +39 -35
  57. data/testing/rspec/spec/integration/{example_integration_spec.rb → models/example_integration_spec.rb} +109 -83
  58. data/testing/rspec/spec/integration/{feature_file_integration_spec.rb → models/feature_file_integration_spec.rb} +52 -38
  59. data/testing/rspec/spec/integration/{feature_integration_spec.rb → models/feature_integration_spec.rb} +125 -112
  60. data/testing/rspec/spec/integration/{model_integration_spec.rb → models/model_integration_spec.rb} +1 -1
  61. data/testing/rspec/spec/integration/{outline_integration_spec.rb → models/outline_integration_spec.rb} +138 -129
  62. data/testing/rspec/spec/integration/{row_integration_spec.rb → models/row_integration_spec.rb} +55 -35
  63. data/testing/rspec/spec/integration/{scenario_integration_spec.rb → models/scenario_integration_spec.rb} +92 -88
  64. data/testing/rspec/spec/integration/models/step_integration_spec.rb +573 -0
  65. data/testing/rspec/spec/integration/{table_integration_spec.rb → models/table_integration_spec.rb} +38 -34
  66. data/testing/rspec/spec/integration/{tag_integration_spec.rb → models/tag_integration_spec.rb} +56 -36
  67. data/testing/rspec/spec/integration/parsing_integration_spec.rb +45 -7
  68. data/testing/rspec/spec/spec_helper.rb +79 -43
  69. data/testing/rspec/spec/unit/cuke_modeler_unit_spec.rb +25 -0
  70. data/testing/rspec/spec/unit/{background_unit_spec.rb → models/background_unit_spec.rb} +1 -1
  71. data/testing/rspec/spec/unit/{cell_unit_spec.rb → models/cell_unit_spec.rb} +1 -1
  72. data/testing/rspec/spec/unit/{comment_unit_spec.rb → models/comment_unit_spec.rb} +1 -1
  73. data/testing/rspec/spec/unit/{directory_unit_spec.rb → models/directory_unit_spec.rb} +1 -1
  74. data/testing/rspec/spec/unit/{doc_string_unit_spec.rb → models/doc_string_unit_spec.rb} +1 -1
  75. data/testing/rspec/spec/unit/{example_unit_spec.rb → models/example_unit_spec.rb} +1 -1
  76. data/testing/rspec/spec/unit/{feature_file_unit_spec.rb → models/feature_file_unit_spec.rb} +1 -1
  77. data/testing/rspec/spec/unit/{feature_unit_spec.rb → models/feature_unit_spec.rb} +1 -1
  78. data/testing/rspec/spec/unit/{model_unit_spec.rb → models/model_unit_spec.rb} +1 -1
  79. data/testing/rspec/spec/unit/{outline_unit_spec.rb → models/outline_unit_spec.rb} +1 -1
  80. data/testing/rspec/spec/unit/{row_unit_spec.rb → models/row_unit_spec.rb} +1 -1
  81. data/testing/rspec/spec/unit/{scenario_unit_spec.rb → models/scenario_unit_spec.rb} +1 -1
  82. data/testing/rspec/spec/unit/{step_unit_spec.rb → models/step_unit_spec.rb} +2 -2
  83. data/testing/rspec/spec/unit/{table_unit_spec.rb → models/table_unit_spec.rb} +1 -1
  84. data/testing/rspec/spec/unit/{tag_unit_spec.rb → models/tag_unit_spec.rb} +1 -1
  85. data/testing/rspec/spec/unit/shared/containing_models_unit_specs.rb +102 -0
  86. data/todo.txt +5 -2
  87. metadata +80 -47
  88. data/History.md +0 -186
  89. data/testing/cucumber/support/transforms.rb +0 -3
  90. data/testing/rspec/spec/integration/step_integration_spec.rb +0 -459
@@ -1,4 +1,4 @@
1
- require "#{File.dirname(__FILE__)}/../spec_helper"
1
+ require "#{File.dirname(__FILE__)}/../../spec_helper"
2
2
 
3
3
 
4
4
  describe 'Row, Integration' do
@@ -44,28 +44,48 @@ 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
48
- example_row = clazz.new("| a | row |")
49
- data = example_row.parsing_data
47
+ describe 'parsing data' do
50
48
 
51
- expect(data.keys).to match_array([:type, :location, :cells])
52
- expect(data[:type]).to eq(:TableRow)
53
- end
49
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(8, 9) do
50
+ example_row = clazz.new("| a | row |")
51
+ data = example_row.parsing_data
54
52
 
55
- it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
56
- example_row = clazz.new("| a | row |")
57
- data = example_row.parsing_data
53
+ expect(data.keys).to match_array([:location, :cells, :id])
54
+ expect(data[:location][:line]).to eq(5)
55
+ end
58
56
 
59
- expect(data.keys).to match_array([:type, :location, :cells])
60
- expect(data[:type]).to eq('TableRow')
61
- end
57
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(6, 7) do
58
+ example_row = clazz.new("| a | row |")
59
+ data = example_row.parsing_data
62
60
 
63
- it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
64
- example_row = clazz.new("| a | row |")
65
- data = example_row.parsing_data
61
+ expect(data.keys).to match_array([:location, :cells])
62
+ expect(data[:location][:line]).to eq(5)
63
+ end
64
+
65
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(4, 5) do
66
+ example_row = clazz.new("| a | row |")
67
+ data = example_row.parsing_data
68
+
69
+ expect(data.keys).to match_array([:type, :location, :cells])
70
+ expect(data[:type]).to eq(:TableRow)
71
+ end
72
+
73
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(3) do
74
+ example_row = clazz.new("| a | row |")
75
+ data = example_row.parsing_data
76
+
77
+ expect(data.keys).to match_array([:type, :location, :cells])
78
+ expect(data[:type]).to eq('TableRow')
79
+ end
80
+
81
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(2) do
82
+ example_row = clazz.new("| a | row |")
83
+ data = example_row.parsing_data
84
+
85
+ expect(data.keys).to match_array(['cells', 'line'])
86
+ expect(data['line']).to eq(5)
87
+ end
66
88
 
67
- expect(data.keys).to match_array(['cells', 'line'])
68
- expect(data['line']).to eq(5)
69
89
  end
70
90
 
71
91
  it 'properly sets its child models' do
@@ -88,10 +108,10 @@ describe 'Row, Integration' do
88
108
 
89
109
 
90
110
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
91
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
111
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
92
112
 
93
- #{@scenario_keyword}: Test test
94
- #{@step_keyword} a step:
113
+ #{SCENARIO_KEYWORD}: Test test
114
+ #{STEP_KEYWORD} a step:
95
115
  | a | table |"
96
116
  }
97
117
 
@@ -132,10 +152,10 @@ describe 'Row, Integration' do
132
152
  context 'a row that is part of a scenario' do
133
153
 
134
154
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
135
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
155
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
136
156
 
137
- #{@scenario_keyword}: Test test
138
- #{@step_keyword} a step:
157
+ #{SCENARIO_KEYWORD}: Test test
158
+ #{STEP_KEYWORD} a step:
139
159
  | a | table |"
140
160
  }
141
161
 
@@ -155,10 +175,10 @@ describe 'Row, Integration' do
155
175
  context 'a row that is part of a background' do
156
176
 
157
177
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
158
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
178
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
159
179
 
160
- #{@background_keyword}: Test background
161
- #{@step_keyword} a step:
180
+ #{BACKGROUND_KEYWORD}: Test background
181
+ #{STEP_KEYWORD} a step:
162
182
  | a | table |"
163
183
  }
164
184
 
@@ -177,11 +197,11 @@ describe 'Row, Integration' do
177
197
  context 'a row that is part of an outline' do
178
198
 
179
199
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
180
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
200
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
181
201
 
182
- #{@outline_keyword}: Test outline
183
- #{@step_keyword} a step
184
- #{@example_keyword}:
202
+ #{OUTLINE_KEYWORD}: Test outline
203
+ #{STEP_KEYWORD} a step
204
+ #{EXAMPLE_KEYWORD}:
185
205
  | param |
186
206
  | value |"
187
207
  }
@@ -228,11 +248,11 @@ describe 'Row, Integration' do
228
248
  end
229
249
 
230
250
  it "models the row's source line" do
231
- source_text = "#{@feature_keyword}: Test feature
251
+ source_text = "#{FEATURE_KEYWORD}: Test feature
232
252
 
233
- #{@outline_keyword}: Test outline
234
- #{@step_keyword} a step
235
- #{@example_keyword}:
253
+ #{OUTLINE_KEYWORD}: Test outline
254
+ #{STEP_KEYWORD} a step
255
+ #{EXAMPLE_KEYWORD}:
236
256
  | param |
237
257
  | value |"
238
258
  row = CukeModeler::Feature.new(source_text).tests.first.examples.first.rows.first
@@ -1,4 +1,4 @@
1
- require "#{File.dirname(__FILE__)}/../spec_helper"
1
+ require "#{File.dirname(__FILE__)}/../../spec_helper"
2
2
 
3
3
 
4
4
  describe 'Scenario, Integration' do
@@ -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,39 +38,43 @@ 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")
48
- data = scenario.parsing_data
46
+ describe 'parsing data' do
49
47
 
50
- expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
51
- expect(data[:type]).to eq(:Scenario)
52
- end
48
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(6, 7, 8, 9) do
49
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
50
+ data = scenario.parsing_data
53
51
 
54
- 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")
56
- data = scenario.parsing_data
52
+ expect(data.keys).to match_array([:background, :rule, :scenario])
53
+ expect(data[:scenario][:name]).to eq('test scenario')
54
+ end
57
55
 
58
- expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
59
- expect(data[:type]).to eq(:Scenario)
60
- end
56
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(3, 4, 5) do
57
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
58
+ data = scenario.parsing_data
61
59
 
62
- 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")
64
- data = scenario.parsing_data
60
+ expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
61
+ expect(data[:type]).to eq(:Scenario)
62
+ end
63
+
64
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(2) do
65
+ scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
66
+ data = scenario.parsing_data
67
+
68
+ expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'steps', 'tags'])
69
+ expect(data['keyword']).to eq('Scenario')
70
+ end
65
71
 
66
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'steps', 'tags'])
67
- expect(data['keyword']).to eq('Scenario')
68
72
  end
69
73
 
70
74
  it 'properly sets its child models' do
71
75
  source = "@a_tag
72
- #{@scenario_keyword}: Test scenario
73
- #{@step_keyword} a step"
76
+ #{SCENARIO_KEYWORD}: Test scenario
77
+ #{STEP_KEYWORD} a step"
74
78
 
75
79
  scenario = clazz.new(source)
76
80
  step = scenario.steps.first
@@ -81,7 +85,7 @@ describe 'Scenario, Integration' do
81
85
  end
82
86
 
83
87
  it 'trims whitespace from its source description' do
84
- source = ["#{@scenario_keyword}:",
88
+ source = ["#{SCENARIO_KEYWORD}:",
85
89
  ' ',
86
90
  ' description line 1',
87
91
  '',
@@ -90,7 +94,7 @@ describe 'Scenario, Integration' do
90
94
  '',
91
95
  '',
92
96
  '',
93
- " #{@step_keyword} a step"]
97
+ " #{STEP_KEYWORD} a step"]
94
98
  source = source.join("\n")
95
99
 
96
100
  scenario = clazz.new(source)
@@ -111,10 +115,10 @@ describe 'Scenario, Integration' do
111
115
 
112
116
 
113
117
  let(:test_directory) { CukeModeler::FileHelper.create_directory }
114
- let(:source_gherkin) { "#{@feature_keyword}: Test feature
118
+ let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
115
119
 
116
- #{@scenario_keyword}: Test test
117
- #{@step_keyword} a step"
120
+ #{SCENARIO_KEYWORD}: Test test
121
+ #{STEP_KEYWORD} a step"
118
122
  }
119
123
 
120
124
  let(:directory_model) { CukeModeler::Directory.new(test_directory) }
@@ -152,19 +156,19 @@ describe 'Scenario, Integration' do
152
156
 
153
157
  context 'from source text' do
154
158
 
155
- let(:source_text) { "#{@scenario_keyword}:" }
159
+ let(:source_text) { "#{SCENARIO_KEYWORD}:" }
156
160
  let(:scenario) { clazz.new(source_text) }
157
161
 
158
162
 
159
163
  it "models the scenario's keyword" do
160
- expect(scenario.keyword).to eq("#{@scenario_keyword}")
164
+ expect(scenario.keyword).to eq("#{SCENARIO_KEYWORD}")
161
165
  end
162
166
 
163
167
  it "models the scenario's source line" do
164
- source_text = "#{@feature_keyword}:
168
+ source_text = "#{FEATURE_KEYWORD}:
165
169
 
166
- #{@scenario_keyword}: foo
167
- #{@step_keyword} step"
170
+ #{SCENARIO_KEYWORD}: foo
171
+ #{STEP_KEYWORD} step"
168
172
  scenario = CukeModeler::Feature.new(source_text).tests.first
169
173
 
170
174
  expect(scenario.source_line).to eq(3)
@@ -174,15 +178,15 @@ describe 'Scenario, Integration' do
174
178
  context 'a filled scenario' do
175
179
 
176
180
  let(:source_text) { "@tag1 @tag2 @tag3
177
- #{@scenario_keyword}: Scenario name
181
+ #{SCENARIO_KEYWORD}: Scenario name
178
182
 
179
183
  Scenario description.
180
184
 
181
185
  Some more.
182
186
  Even more.
183
187
 
184
- #{@step_keyword} a step
185
- #{@step_keyword} another step" }
188
+ #{STEP_KEYWORD} a step
189
+ #{STEP_KEYWORD} another step" }
186
190
  let(:scenario) { clazz.new(source_text) }
187
191
 
188
192
 
@@ -215,7 +219,7 @@ describe 'Scenario, Integration' do
215
219
 
216
220
  context 'an empty scenario' do
217
221
 
218
- let(:source_text) { "#{@scenario_keyword}:" }
222
+ let(:source_text) { "#{SCENARIO_KEYWORD}:" }
219
223
  let(:scenario) { clazz.new(source_text) }
220
224
 
221
225
 
@@ -245,19 +249,19 @@ describe 'Scenario, Integration' do
245
249
  describe 'comparison' do
246
250
 
247
251
  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"
252
+ source = "#{SCENARIO_KEYWORD}:
253
+ #{STEP_KEYWORD} step 1
254
+ #{STEP_KEYWORD} step 2"
251
255
  scenario = clazz.new(source)
252
256
 
253
- source = "#{@background_keyword}:
254
- #{@step_keyword} step 1
255
- #{@step_keyword} step 2"
257
+ source = "#{BACKGROUND_KEYWORD}:
258
+ #{STEP_KEYWORD} step 1
259
+ #{STEP_KEYWORD} step 2"
256
260
  background_1 = CukeModeler::Background.new(source)
257
261
 
258
- source = "#{@background_keyword}:
259
- #{@step_keyword} step 2
260
- #{@step_keyword} step 1"
262
+ source = "#{BACKGROUND_KEYWORD}:
263
+ #{STEP_KEYWORD} step 2
264
+ #{STEP_KEYWORD} step 1"
261
265
  background_2 = CukeModeler::Background.new(source)
262
266
 
263
267
 
@@ -266,19 +270,19 @@ describe 'Scenario, Integration' do
266
270
  end
267
271
 
268
272
  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"
273
+ source = "#{SCENARIO_KEYWORD}:
274
+ #{STEP_KEYWORD} step 1
275
+ #{STEP_KEYWORD} step 2"
272
276
  scenario_1 = clazz.new(source)
273
277
 
274
- source = "#{@scenario_keyword}:
275
- #{@step_keyword} step 1
276
- #{@step_keyword} step 2"
278
+ source = "#{SCENARIO_KEYWORD}:
279
+ #{STEP_KEYWORD} step 1
280
+ #{STEP_KEYWORD} step 2"
277
281
  scenario_2 = clazz.new(source)
278
282
 
279
- source = "#{@scenario_keyword}:
280
- #{@step_keyword} step 2
281
- #{@step_keyword} step 1"
283
+ source = "#{SCENARIO_KEYWORD}:
284
+ #{STEP_KEYWORD} step 2
285
+ #{STEP_KEYWORD} step 1"
282
286
  scenario_3 = clazz.new(source)
283
287
 
284
288
 
@@ -287,23 +291,23 @@ describe 'Scenario, Integration' do
287
291
  end
288
292
 
289
293
  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"
294
+ source = "#{SCENARIO_KEYWORD}:
295
+ #{STEP_KEYWORD} step 1
296
+ #{STEP_KEYWORD} step 2"
293
297
  scenario = clazz.new(source)
294
298
 
295
- source = "#{@outline_keyword}:
296
- #{@step_keyword} step 1
297
- #{@step_keyword} step 2
298
- #{@example_keyword}:
299
+ source = "#{OUTLINE_KEYWORD}:
300
+ #{STEP_KEYWORD} step 1
301
+ #{STEP_KEYWORD} step 2
302
+ #{EXAMPLE_KEYWORD}:
299
303
  | param |
300
304
  | value |"
301
305
  outline_1 = CukeModeler::Outline.new(source)
302
306
 
303
- source = "#{@outline_keyword}:
304
- #{@step_keyword} step 2
305
- #{@step_keyword} step 1
306
- #{@example_keyword}:
307
+ source = "#{OUTLINE_KEYWORD}:
308
+ #{STEP_KEYWORD} step 2
309
+ #{STEP_KEYWORD} step 1
310
+ #{EXAMPLE_KEYWORD}:
307
311
  | param |
308
312
  | value |"
309
313
  outline_2 = CukeModeler::Outline.new(source)
@@ -320,14 +324,14 @@ describe 'Scenario, Integration' do
320
324
 
321
325
  it 'can be remade from its own output' do
322
326
  source = "@tag1 @tag2 @tag3
323
- #{@scenario_keyword}: A scenario with everything it could have
327
+ #{SCENARIO_KEYWORD}: A scenario with everything it could have
324
328
 
325
329
  Including a description
326
330
  and then some.
327
331
 
328
- #{@step_keyword} a step
332
+ #{STEP_KEYWORD} a step
329
333
  | value |
330
- #{@step_keyword} another step
334
+ #{STEP_KEYWORD} another step
331
335
  \"\"\"
332
336
  some string
333
337
  \"\"\""
@@ -343,27 +347,27 @@ describe 'Scenario, Integration' do
343
347
  context 'from source text' do
344
348
 
345
349
  it 'can output an empty scenario' do
346
- source = ["#{@scenario_keyword}:"]
350
+ source = ["#{SCENARIO_KEYWORD}:"]
347
351
  source = source.join("\n")
348
352
  scenario = clazz.new(source)
349
353
 
350
354
  scenario_output = scenario.to_s.split("\n", -1)
351
355
 
352
- expect(scenario_output).to eq(["#{@scenario_keyword}:"])
356
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:"])
353
357
  end
354
358
 
355
359
  it 'can output a scenario that has a name' do
356
- source = ["#{@scenario_keyword}: test scenario"]
360
+ source = ["#{SCENARIO_KEYWORD}: test scenario"]
357
361
  source = source.join("\n")
358
362
  scenario = clazz.new(source)
359
363
 
360
364
  scenario_output = scenario.to_s.split("\n", -1)
361
365
 
362
- expect(scenario_output).to eq(["#{@scenario_keyword}: test scenario"])
366
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}: test scenario"])
363
367
  end
364
368
 
365
369
  it 'can output a scenario that has a description' do
366
- source = ["#{@scenario_keyword}:",
370
+ source = ["#{SCENARIO_KEYWORD}:",
367
371
  'Some description.',
368
372
  'Some more description.']
369
373
  source = source.join("\n")
@@ -371,17 +375,17 @@ describe 'Scenario, Integration' do
371
375
 
372
376
  scenario_output = scenario.to_s.split("\n", -1)
373
377
 
374
- expect(scenario_output).to eq(["#{@scenario_keyword}:",
378
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:",
375
379
  '',
376
380
  'Some description.',
377
381
  'Some more description.'])
378
382
  end
379
383
 
380
384
  it 'can output a scenario that has steps' do
381
- source = ["#{@scenario_keyword}:",
382
- "#{@step_keyword} a step",
385
+ source = ["#{SCENARIO_KEYWORD}:",
386
+ "#{STEP_KEYWORD} a step",
383
387
  '|value|',
384
- "#{@step_keyword} another step",
388
+ "#{STEP_KEYWORD} another step",
385
389
  '"""',
386
390
  'some string',
387
391
  '"""']
@@ -390,10 +394,10 @@ describe 'Scenario, Integration' do
390
394
 
391
395
  scenario_output = scenario.to_s.split("\n", -1)
392
396
 
393
- expect(scenario_output).to eq(["#{@scenario_keyword}:",
394
- " #{@step_keyword} a step",
397
+ expect(scenario_output).to eq(["#{SCENARIO_KEYWORD}:",
398
+ " #{STEP_KEYWORD} a step",
395
399
  ' | value |',
396
- " #{@step_keyword} another step",
400
+ " #{STEP_KEYWORD} another step",
397
401
  ' """',
398
402
  ' some string',
399
403
  ' """'])
@@ -402,24 +406,24 @@ describe 'Scenario, Integration' do
402
406
  it 'can output a scenario that has tags' do
403
407
  source = ['@tag1 @tag2',
404
408
  '@tag3',
405
- "#{@scenario_keyword}:"]
409
+ "#{SCENARIO_KEYWORD}:"]
406
410
  source = source.join("\n")
407
411
  scenario = clazz.new(source)
408
412
 
409
413
  scenario_output = scenario.to_s.split("\n", -1)
410
414
 
411
415
  expect(scenario_output).to eq(['@tag1 @tag2 @tag3',
412
- "#{@scenario_keyword}:"])
416
+ "#{SCENARIO_KEYWORD}:"])
413
417
  end
414
418
 
415
419
  it 'can output a scenario that has everything' do
416
420
  source = ['@tag1 @tag2 @tag3',
417
- "#{@scenario_keyword}: A scenario with everything it could have",
421
+ "#{SCENARIO_KEYWORD}: A scenario with everything it could have",
418
422
  'Including a description',
419
423
  'and then some.',
420
- "#{@step_keyword} a step",
424
+ "#{STEP_KEYWORD} a step",
421
425
  '|value|',
422
- "#{@step_keyword} another step",
426
+ "#{STEP_KEYWORD} another step",
423
427
  '"""',
424
428
  'some string',
425
429
  '"""']
@@ -429,14 +433,14 @@ describe 'Scenario, Integration' do
429
433
  scenario_output = scenario.to_s.split("\n", -1)
430
434
 
431
435
  expect(scenario_output).to eq(['@tag1 @tag2 @tag3',
432
- "#{@scenario_keyword}: A scenario with everything it could have",
436
+ "#{SCENARIO_KEYWORD}: A scenario with everything it could have",
433
437
  '',
434
438
  'Including a description',
435
439
  'and then some.',
436
440
  '',
437
- " #{@step_keyword} a step",
441
+ " #{STEP_KEYWORD} a step",
438
442
  ' | value |',
439
- " #{@step_keyword} another step",
443
+ " #{STEP_KEYWORD} another step",
440
444
  ' """',
441
445
  ' some string',
442
446
  ' """'])