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.
- checksums.yaml +5 -5
- data/.travis.yml +60 -17
- data/CHANGELOG.md +312 -0
- data/Gemfile +19 -3
- data/LICENSE.txt +1 -1
- data/README.md +17 -7
- data/Rakefile +45 -28
- data/appveyor.yml +57 -17
- data/cuke_modeler.gemspec +6 -3
- data/lib/cuke_modeler/adapters/gherkin_2_adapter.rb +1 -0
- data/lib/cuke_modeler/adapters/gherkin_3_adapter.rb +1 -0
- data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +2 -1
- data/lib/cuke_modeler/adapters/gherkin_5_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_6_adapter.rb +310 -0
- data/lib/cuke_modeler/adapters/gherkin_7_adapter.rb +307 -0
- data/lib/cuke_modeler/adapters/gherkin_8_adapter.rb +12 -0
- data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +12 -0
- data/lib/cuke_modeler/containing.rb +16 -0
- data/lib/cuke_modeler/described.rb +1 -0
- data/lib/cuke_modeler/models/step.rb +31 -2
- data/lib/cuke_modeler/named.rb +1 -0
- data/lib/cuke_modeler/nested.rb +1 -0
- data/lib/cuke_modeler/parsed.rb +1 -0
- data/lib/cuke_modeler/parsing.rb +116 -68
- data/lib/cuke_modeler/sourceable.rb +1 -0
- data/lib/cuke_modeler/stepped.rb +1 -0
- data/lib/cuke_modeler/taggable.rb +1 -0
- data/lib/cuke_modeler/version.rb +1 -1
- data/testing/cucumber/features/analysis/step_comparison.feature +25 -0
- data/testing/cucumber/features/analysis/test_comparison.feature +1 -1
- data/testing/cucumber/step_definitions/feature_file_steps.rb +1 -1
- data/testing/cucumber/step_definitions/modeling_steps.rb +7 -2
- data/testing/cucumber/step_definitions/verification_steps.rb +11 -2
- data/testing/file_helper.rb +3 -0
- data/testing/gemfiles/gherkin2.gemfile +8 -0
- data/testing/gemfiles/gherkin3.gemfile +6 -0
- data/testing/gemfiles/gherkin4.gemfile +7 -0
- data/testing/gemfiles/gherkin5.gemfile +7 -0
- data/testing/gemfiles/gherkin6.gemfile +10 -0
- data/testing/gemfiles/gherkin7.gemfile +9 -0
- data/testing/gemfiles/gherkin8.gemfile +9 -0
- data/testing/gemfiles/gherkin9.gemfile +9 -0
- data/testing/helper_methods.rb +23 -0
- data/testing/rspec/spec/integration/{gherkin_2_adapter_spec.rb → adapters/gherkin_2_adapter_spec.rb} +13 -13
- data/testing/rspec/spec/integration/{gherkin_3_adapter_spec.rb → adapters/gherkin_3_adapter_spec.rb} +13 -13
- data/testing/rspec/spec/integration/{gherkin_4_adapter_spec.rb → adapters/gherkin_4_adapter_spec.rb} +13 -13
- data/testing/rspec/spec/integration/adapters/gherkin_5_adapter_spec.rb +165 -0
- data/testing/rspec/spec/integration/adapters/gherkin_6_adapter_spec.rb +159 -0
- data/testing/rspec/spec/integration/adapters/gherkin_7_adapter_spec.rb +162 -0
- data/testing/rspec/spec/integration/adapters/gherkin_8_adapter_spec.rb +162 -0
- data/testing/rspec/spec/integration/adapters/gherkin_9_adapter_spec.rb +162 -0
- data/testing/rspec/spec/integration/{background_integration_spec.rb → models/background_integration_spec.rb} +90 -86
- data/testing/rspec/spec/integration/{cell_integration_spec.rb → models/cell_integration_spec.rb} +49 -38
- data/testing/rspec/spec/integration/{comment_integration_spec.rb → models/comment_integration_spec.rb} +31 -20
- data/testing/rspec/spec/integration/{directory_integration_spec.rb → models/directory_integration_spec.rb} +3 -3
- data/testing/rspec/spec/integration/{doc_string_integration_spec.rb → models/doc_string_integration_spec.rb} +39 -35
- data/testing/rspec/spec/integration/{example_integration_spec.rb → models/example_integration_spec.rb} +109 -83
- data/testing/rspec/spec/integration/{feature_file_integration_spec.rb → models/feature_file_integration_spec.rb} +52 -38
- data/testing/rspec/spec/integration/{feature_integration_spec.rb → models/feature_integration_spec.rb} +125 -112
- data/testing/rspec/spec/integration/{model_integration_spec.rb → models/model_integration_spec.rb} +1 -1
- data/testing/rspec/spec/integration/{outline_integration_spec.rb → models/outline_integration_spec.rb} +138 -129
- data/testing/rspec/spec/integration/{row_integration_spec.rb → models/row_integration_spec.rb} +55 -35
- data/testing/rspec/spec/integration/{scenario_integration_spec.rb → models/scenario_integration_spec.rb} +92 -88
- data/testing/rspec/spec/integration/models/step_integration_spec.rb +573 -0
- data/testing/rspec/spec/integration/{table_integration_spec.rb → models/table_integration_spec.rb} +38 -34
- data/testing/rspec/spec/integration/{tag_integration_spec.rb → models/tag_integration_spec.rb} +56 -36
- data/testing/rspec/spec/integration/parsing_integration_spec.rb +45 -7
- data/testing/rspec/spec/spec_helper.rb +79 -43
- data/testing/rspec/spec/unit/cuke_modeler_unit_spec.rb +25 -0
- data/testing/rspec/spec/unit/{background_unit_spec.rb → models/background_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{cell_unit_spec.rb → models/cell_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{comment_unit_spec.rb → models/comment_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{directory_unit_spec.rb → models/directory_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{doc_string_unit_spec.rb → models/doc_string_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{example_unit_spec.rb → models/example_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{feature_file_unit_spec.rb → models/feature_file_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{feature_unit_spec.rb → models/feature_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{model_unit_spec.rb → models/model_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{outline_unit_spec.rb → models/outline_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{row_unit_spec.rb → models/row_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{scenario_unit_spec.rb → models/scenario_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{step_unit_spec.rb → models/step_unit_spec.rb} +2 -2
- data/testing/rspec/spec/unit/{table_unit_spec.rb → models/table_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/{tag_unit_spec.rb → models/tag_unit_spec.rb} +1 -1
- data/testing/rspec/spec/unit/shared/containing_models_unit_specs.rb +102 -0
- data/todo.txt +5 -2
- metadata +80 -47
- data/History.md +0 -186
- data/testing/cucumber/support/transforms.rb +0 -3
- data/testing/rspec/spec/integration/step_integration_spec.rb +0 -459
@@ -1,4 +1,4 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}
|
1
|
+
require "#{File.dirname(__FILE__)}/../../spec_helper"
|
2
2
|
|
3
3
|
|
4
4
|
describe 'Outline, Integration' do
|
@@ -14,22 +14,16 @@ describe 'Outline, Integration' do
|
|
14
14
|
|
15
15
|
describe 'unique behavior' do
|
16
16
|
|
17
|
-
it 'can be instantiated with the minimum viable Gherkin', :
|
18
|
-
source = "#{
|
19
|
-
|
20
|
-
expect { clazz.new(source) }.to_not raise_error
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'can be instantiated with the minimum viable Gherkin', :gherkin2 => true do
|
24
|
-
source = "#{@outline_keyword}:"
|
17
|
+
it 'can be instantiated with the minimum viable Gherkin', :unless => gherkin?(3) do
|
18
|
+
source = "#{OUTLINE_KEYWORD}:"
|
25
19
|
|
26
20
|
expect { clazz.new(source) }.to_not raise_error
|
27
21
|
end
|
28
22
|
|
29
23
|
# gherkin 3.x does not accept incomplete outlines
|
30
|
-
it 'can be instantiated with the minimum viable Gherkin', :
|
31
|
-
source = "#{
|
32
|
-
#{
|
24
|
+
it 'can be instantiated with the minimum viable Gherkin', :if => gherkin?(3) do
|
25
|
+
source = "#{OUTLINE_KEYWORD}:
|
26
|
+
#{EXAMPLE_KEYWORD}:
|
33
27
|
| param |
|
34
28
|
| value |"
|
35
29
|
|
@@ -57,41 +51,45 @@ describe 'Outline, Integration' do
|
|
57
51
|
end
|
58
52
|
end
|
59
53
|
|
60
|
-
|
61
|
-
outline = clazz.new("@tag\n#{@outline_keyword}: test outline\ndescription\n#{@step_keyword} a step\n#{@example_keyword}:\n|param|\n|value|")
|
62
|
-
data = outline.parsing_data
|
54
|
+
describe 'parsing data' do
|
63
55
|
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
it 'stores the original data generated by the parsing adapter', :if => gherkin?(6, 7, 8, 9) do
|
57
|
+
outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
|
58
|
+
data = outline.parsing_data
|
67
59
|
|
68
|
-
|
69
|
-
|
70
|
-
|
60
|
+
expect(data.keys).to match_array([:background, :rule, :scenario])
|
61
|
+
expect(data[:scenario][:name]).to eq('test outline')
|
62
|
+
end
|
71
63
|
|
72
|
-
|
73
|
-
|
74
|
-
|
64
|
+
it 'stores the original data generated by the parsing adapter', :if => gherkin?(3, 4, 5) do
|
65
|
+
outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
|
66
|
+
data = outline.parsing_data
|
67
|
+
|
68
|
+
expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :examples, :description])
|
69
|
+
expect(data[:type]).to eq(:ScenarioOutline)
|
70
|
+
end
|
75
71
|
|
76
|
-
|
77
|
-
|
78
|
-
|
72
|
+
it 'stores the original data generated by the parsing adapter', :if => gherkin?(2) do
|
73
|
+
outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
|
74
|
+
data = outline.parsing_data
|
75
|
+
|
76
|
+
expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'examples', 'steps', 'tags'])
|
77
|
+
expect(data['keyword']).to eq('Scenario Outline')
|
78
|
+
end
|
79
79
|
|
80
|
-
expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'examples', 'steps', 'tags'])
|
81
|
-
expect(data['keyword']).to eq('Scenario Outline')
|
82
80
|
end
|
83
81
|
|
84
82
|
it 'provides a descriptive filename when being parsed from stand alone text' do
|
85
|
-
source = "bad outline text \n #{
|
83
|
+
source = "bad outline text \n #{OUTLINE_KEYWORD}:\n #{STEP_KEYWORD} a step\n @foo "
|
86
84
|
|
87
85
|
expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_outline\.feature'/)
|
88
86
|
end
|
89
87
|
|
90
88
|
it 'properly sets its child models' do
|
91
89
|
source = "@a_tag
|
92
|
-
#{
|
93
|
-
#{
|
94
|
-
#{
|
90
|
+
#{OUTLINE_KEYWORD}:
|
91
|
+
#{STEP_KEYWORD} a step
|
92
|
+
#{EXAMPLE_KEYWORD}:
|
95
93
|
| param |
|
96
94
|
| value |"
|
97
95
|
|
@@ -113,11 +111,11 @@ describe 'Outline, Integration' do
|
|
113
111
|
|
114
112
|
|
115
113
|
let(:test_directory) { CukeModeler::FileHelper.create_directory }
|
116
|
-
let(:source_gherkin) { "#{
|
114
|
+
let(:source_gherkin) { "#{FEATURE_KEYWORD}: Test feature
|
117
115
|
|
118
|
-
#{
|
119
|
-
#{
|
120
|
-
#{
|
116
|
+
#{OUTLINE_KEYWORD}: Test test
|
117
|
+
#{STEP_KEYWORD} a step
|
118
|
+
#{EXAMPLE_KEYWORD}: Test example
|
121
119
|
| a param |
|
122
120
|
| a value |"
|
123
121
|
}
|
@@ -157,21 +155,32 @@ describe 'Outline, Integration' do
|
|
157
155
|
|
158
156
|
context 'from source text' do
|
159
157
|
|
160
|
-
let(:source_text) { "#{
|
158
|
+
let(:source_text) { "#{OUTLINE_KEYWORD}:" }
|
161
159
|
let(:outline) { clazz.new(source_text) }
|
162
160
|
|
163
161
|
|
164
162
|
# gherkin 3.x does not accept incomplete outlines
|
165
|
-
it "models the outline's keyword", :
|
166
|
-
expect(outline.keyword).to eq("#{
|
163
|
+
it "models the outline's keyword", :unless => gherkin?(3) do
|
164
|
+
expect(outline.keyword).to eq("#{OUTLINE_KEYWORD}")
|
165
|
+
end
|
166
|
+
|
167
|
+
context 'using gherkin 3.x', :if => gherkin?(3) do
|
168
|
+
|
169
|
+
let(:source_text) { "#{OUTLINE_KEYWORD}:\n#{STEP_KEYWORD} step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|" }
|
170
|
+
let(:outline) { clazz.new(source_text) }
|
171
|
+
|
172
|
+
it "models the outline's keyword" do
|
173
|
+
expect(outline.keyword).to eq(OUTLINE_KEYWORD)
|
174
|
+
end
|
175
|
+
|
167
176
|
end
|
168
177
|
|
169
178
|
it "models the outline's source line" do
|
170
|
-
source_text = "#{
|
179
|
+
source_text = "#{FEATURE_KEYWORD}:
|
171
180
|
|
172
|
-
#{
|
173
|
-
#{
|
174
|
-
#{
|
181
|
+
#{OUTLINE_KEYWORD}: foo
|
182
|
+
#{STEP_KEYWORD} step
|
183
|
+
#{EXAMPLE_KEYWORD}:
|
175
184
|
| param |
|
176
185
|
| value |"
|
177
186
|
outline = CukeModeler::Feature.new(source_text).tests.first
|
@@ -183,20 +192,20 @@ describe 'Outline, Integration' do
|
|
183
192
|
context 'a filled outline' do
|
184
193
|
|
185
194
|
let(:source_text) { "@tag1 @tag2 @tag3
|
186
|
-
#{
|
195
|
+
#{OUTLINE_KEYWORD}: Foo
|
187
196
|
Scenario description.
|
188
197
|
|
189
198
|
Some more.
|
190
199
|
Even more.
|
191
200
|
|
192
|
-
#{
|
193
|
-
#{
|
194
|
-
#{
|
201
|
+
#{STEP_KEYWORD} a <setup> step
|
202
|
+
#{STEP_KEYWORD} an action step
|
203
|
+
#{STEP_KEYWORD} a <verification> step
|
195
204
|
|
196
|
-
#{
|
205
|
+
#{EXAMPLE_KEYWORD}: example 1
|
197
206
|
| setup | verification |
|
198
207
|
| x | y |
|
199
|
-
#{
|
208
|
+
#{EXAMPLE_KEYWORD}: example 2
|
200
209
|
| setup | verification |
|
201
210
|
| a | b |" }
|
202
211
|
let(:outline) { clazz.new(source_text) }
|
@@ -237,9 +246,9 @@ describe 'Outline, Integration' do
|
|
237
246
|
|
238
247
|
|
239
248
|
# gherkin 3.x does not accept incomplete outlines
|
240
|
-
context 'an empty outline', :
|
249
|
+
context 'an empty outline', :unless => gherkin?(3) do
|
241
250
|
|
242
|
-
let(:source_text) { "#{
|
251
|
+
let(:source_text) { "#{OUTLINE_KEYWORD}:" }
|
243
252
|
let(:outline) { clazz.new(source_text) }
|
244
253
|
|
245
254
|
|
@@ -270,7 +279,7 @@ describe 'Outline, Integration' do
|
|
270
279
|
end
|
271
280
|
|
272
281
|
it 'trims whitespace from its source description' do
|
273
|
-
source = ["#{
|
282
|
+
source = ["#{OUTLINE_KEYWORD}:",
|
274
283
|
' ',
|
275
284
|
' description line 1',
|
276
285
|
'',
|
@@ -279,9 +288,9 @@ describe 'Outline, Integration' do
|
|
279
288
|
'',
|
280
289
|
'',
|
281
290
|
'',
|
282
|
-
" #{
|
291
|
+
" #{STEP_KEYWORD} a step",
|
283
292
|
'',
|
284
|
-
"#{
|
293
|
+
"#{EXAMPLE_KEYWORD}:",
|
285
294
|
'|param|',
|
286
295
|
'|value|']
|
287
296
|
source = source.join("\n")
|
@@ -299,22 +308,22 @@ describe 'Outline, Integration' do
|
|
299
308
|
describe 'comparison' do
|
300
309
|
|
301
310
|
it 'is equal to a background with the same steps' do
|
302
|
-
source = "#{
|
303
|
-
#{
|
304
|
-
#{
|
305
|
-
#{
|
311
|
+
source = "#{OUTLINE_KEYWORD}:
|
312
|
+
#{STEP_KEYWORD} step 1
|
313
|
+
#{STEP_KEYWORD} step 2
|
314
|
+
#{EXAMPLE_KEYWORD}:
|
306
315
|
| param |
|
307
316
|
| value |"
|
308
317
|
outline = clazz.new(source)
|
309
318
|
|
310
|
-
source = "#{
|
311
|
-
#{
|
312
|
-
#{
|
319
|
+
source = "#{BACKGROUND_KEYWORD}:
|
320
|
+
#{STEP_KEYWORD} step 1
|
321
|
+
#{STEP_KEYWORD} step 2"
|
313
322
|
background_1 = CukeModeler::Background.new(source)
|
314
323
|
|
315
|
-
source = "#{
|
316
|
-
#{
|
317
|
-
#{
|
324
|
+
source = "#{BACKGROUND_KEYWORD}:
|
325
|
+
#{STEP_KEYWORD} step 2
|
326
|
+
#{STEP_KEYWORD} step 1"
|
318
327
|
background_2 = CukeModeler::Background.new(source)
|
319
328
|
|
320
329
|
|
@@ -323,22 +332,22 @@ describe 'Outline, Integration' do
|
|
323
332
|
end
|
324
333
|
|
325
334
|
it 'is equal to a scenario with the same steps' do
|
326
|
-
source = "#{
|
327
|
-
#{
|
328
|
-
#{
|
329
|
-
#{
|
335
|
+
source = "#{OUTLINE_KEYWORD}:
|
336
|
+
#{STEP_KEYWORD} step 1
|
337
|
+
#{STEP_KEYWORD} step 2
|
338
|
+
#{EXAMPLE_KEYWORD}:
|
330
339
|
| param |
|
331
340
|
| value |"
|
332
341
|
outline = clazz.new(source)
|
333
342
|
|
334
|
-
source = "#{
|
335
|
-
#{
|
336
|
-
#{
|
343
|
+
source = "#{SCENARIO_KEYWORD}:
|
344
|
+
#{STEP_KEYWORD} step 1
|
345
|
+
#{STEP_KEYWORD} step 2"
|
337
346
|
scenario_1 = CukeModeler::Scenario.new(source)
|
338
347
|
|
339
|
-
source = "#{
|
340
|
-
#{
|
341
|
-
#{
|
348
|
+
source = "#{SCENARIO_KEYWORD}:
|
349
|
+
#{STEP_KEYWORD} step 2
|
350
|
+
#{STEP_KEYWORD} step 1"
|
342
351
|
scenario_2 = CukeModeler::Scenario.new(source)
|
343
352
|
|
344
353
|
|
@@ -347,26 +356,26 @@ describe 'Outline, Integration' do
|
|
347
356
|
end
|
348
357
|
|
349
358
|
it 'is equal to an outline with the same steps' do
|
350
|
-
source = "#{
|
351
|
-
#{
|
352
|
-
#{
|
353
|
-
#{
|
359
|
+
source = "#{OUTLINE_KEYWORD}:
|
360
|
+
#{STEP_KEYWORD} step 1
|
361
|
+
#{STEP_KEYWORD} step 2
|
362
|
+
#{EXAMPLE_KEYWORD}:
|
354
363
|
| param |
|
355
364
|
| value |"
|
356
365
|
outline_1 = clazz.new(source)
|
357
366
|
|
358
|
-
source = "#{
|
359
|
-
#{
|
360
|
-
#{
|
361
|
-
#{
|
367
|
+
source = "#{OUTLINE_KEYWORD}:
|
368
|
+
#{STEP_KEYWORD} step 1
|
369
|
+
#{STEP_KEYWORD} step 2
|
370
|
+
#{EXAMPLE_KEYWORD}:
|
362
371
|
| param |
|
363
372
|
| value |"
|
364
373
|
outline_2 = clazz.new(source)
|
365
374
|
|
366
|
-
source = "#{
|
367
|
-
#{
|
368
|
-
#{
|
369
|
-
#{
|
375
|
+
source = "#{OUTLINE_KEYWORD}:
|
376
|
+
#{STEP_KEYWORD} step 2
|
377
|
+
#{STEP_KEYWORD} step 1
|
378
|
+
#{EXAMPLE_KEYWORD}:
|
370
379
|
| param |
|
371
380
|
| value |"
|
372
381
|
outline_3 = clazz.new(source)
|
@@ -383,19 +392,19 @@ describe 'Outline, Integration' do
|
|
383
392
|
|
384
393
|
it 'can be remade from its own output' do
|
385
394
|
source = "@tag1 @tag2 @tag3
|
386
|
-
#{
|
395
|
+
#{OUTLINE_KEYWORD}: An outline with everything it could have
|
387
396
|
|
388
397
|
Some description.
|
389
398
|
Some more description.
|
390
399
|
|
391
|
-
#{
|
400
|
+
#{STEP_KEYWORD} a step
|
392
401
|
| value |
|
393
|
-
#{
|
402
|
+
#{STEP_KEYWORD} a <value> step
|
394
403
|
\"\"\"
|
395
404
|
some string
|
396
405
|
\"\"\"
|
397
406
|
|
398
|
-
#{
|
407
|
+
#{EXAMPLE_KEYWORD}:
|
399
408
|
|
400
409
|
Some description.
|
401
410
|
Some more description.
|
@@ -404,7 +413,7 @@ describe 'Outline, Integration' do
|
|
404
413
|
| x |
|
405
414
|
|
406
415
|
@example_tag
|
407
|
-
#{
|
416
|
+
#{EXAMPLE_KEYWORD}:
|
408
417
|
| value |
|
409
418
|
| y |"
|
410
419
|
outline = clazz.new(source)
|
@@ -419,30 +428,30 @@ describe 'Outline, Integration' do
|
|
419
428
|
context 'from source text' do
|
420
429
|
|
421
430
|
# gherkin 3.x does not accept incomplete outlines
|
422
|
-
it 'can output an empty outline', :
|
423
|
-
source = ["#{
|
431
|
+
it 'can output an empty outline', :unless => gherkin?(3) do
|
432
|
+
source = ["#{OUTLINE_KEYWORD}:"]
|
424
433
|
source = source.join("\n")
|
425
434
|
outline = clazz.new(source)
|
426
435
|
|
427
436
|
outline_output = outline.to_s.split("\n", -1)
|
428
437
|
|
429
|
-
expect(outline_output).to eq(["#{
|
438
|
+
expect(outline_output).to eq(["#{OUTLINE_KEYWORD}:"])
|
430
439
|
end
|
431
440
|
|
432
441
|
# gherkin 3.x does not accept incomplete outlines
|
433
|
-
it 'can output a outline that has a name', :
|
434
|
-
source = ["#{
|
442
|
+
it 'can output a outline that has a name', :unless => gherkin?(3) do
|
443
|
+
source = ["#{OUTLINE_KEYWORD}: test outline"]
|
435
444
|
source = source.join("\n")
|
436
445
|
outline = clazz.new(source)
|
437
446
|
|
438
447
|
outline_output = outline.to_s.split("\n", -1)
|
439
448
|
|
440
|
-
expect(outline_output).to eq(["#{
|
449
|
+
expect(outline_output).to eq(["#{OUTLINE_KEYWORD}: test outline"])
|
441
450
|
end
|
442
451
|
|
443
452
|
# gherkin 3.x does not accept incomplete outlines
|
444
|
-
it 'can output a outline that has a description', :
|
445
|
-
source = ["#{
|
453
|
+
it 'can output a outline that has a description', :unless => gherkin?(3) do
|
454
|
+
source = ["#{OUTLINE_KEYWORD}:",
|
446
455
|
'Some description.',
|
447
456
|
'Some more description.']
|
448
457
|
source = source.join("\n")
|
@@ -450,18 +459,18 @@ describe 'Outline, Integration' do
|
|
450
459
|
|
451
460
|
outline_output = outline.to_s.split("\n", -1)
|
452
461
|
|
453
|
-
expect(outline_output).to eq(["#{
|
462
|
+
expect(outline_output).to eq(["#{OUTLINE_KEYWORD}:",
|
454
463
|
'',
|
455
464
|
'Some description.',
|
456
465
|
'Some more description.'])
|
457
466
|
end
|
458
467
|
|
459
468
|
# gherkin 3.x does not accept incomplete outlines
|
460
|
-
it 'can output a outline that has steps', :
|
461
|
-
source = ["#{
|
462
|
-
" #{
|
469
|
+
it 'can output a outline that has steps', :unless => gherkin?(3) do
|
470
|
+
source = ["#{OUTLINE_KEYWORD}:",
|
471
|
+
" #{STEP_KEYWORD} a step",
|
463
472
|
' | value |',
|
464
|
-
" #{
|
473
|
+
" #{STEP_KEYWORD} another step",
|
465
474
|
' """',
|
466
475
|
' some string',
|
467
476
|
' """']
|
@@ -470,36 +479,36 @@ describe 'Outline, Integration' do
|
|
470
479
|
|
471
480
|
outline_output = outline.to_s.split("\n", -1)
|
472
481
|
|
473
|
-
expect(outline_output).to eq(["#{
|
474
|
-
" #{
|
482
|
+
expect(outline_output).to eq(["#{OUTLINE_KEYWORD}:",
|
483
|
+
" #{STEP_KEYWORD} a step",
|
475
484
|
' | value |',
|
476
|
-
" #{
|
485
|
+
" #{STEP_KEYWORD} another step",
|
477
486
|
' """',
|
478
487
|
' some string',
|
479
488
|
' """'])
|
480
489
|
end
|
481
490
|
|
482
491
|
# gherkin 3.x does not accept incomplete outlines
|
483
|
-
it 'can output a outline that has tags', :
|
492
|
+
it 'can output a outline that has tags', :unless => gherkin?(3) do
|
484
493
|
source = ['@tag1 @tag2',
|
485
494
|
'@tag3',
|
486
|
-
"#{
|
495
|
+
"#{OUTLINE_KEYWORD}:"]
|
487
496
|
source = source.join("\n")
|
488
497
|
outline = clazz.new(source)
|
489
498
|
|
490
499
|
outline_output = outline.to_s.split("\n", -1)
|
491
500
|
|
492
501
|
expect(outline_output).to eq(['@tag1 @tag2 @tag3',
|
493
|
-
"#{
|
502
|
+
"#{OUTLINE_KEYWORD}:"])
|
494
503
|
end
|
495
504
|
|
496
505
|
it 'can output a outline that has examples' do
|
497
|
-
source = ["#{
|
498
|
-
"#{
|
499
|
-
"#{
|
506
|
+
source = ["#{OUTLINE_KEYWORD}:",
|
507
|
+
"#{STEP_KEYWORD} a step",
|
508
|
+
"#{EXAMPLE_KEYWORD}:",
|
500
509
|
'| value |',
|
501
510
|
'| x |',
|
502
|
-
"#{
|
511
|
+
"#{EXAMPLE_KEYWORD}:",
|
503
512
|
'| value |',
|
504
513
|
'| y |']
|
505
514
|
source = source.join("\n")
|
@@ -507,31 +516,31 @@ describe 'Outline, Integration' do
|
|
507
516
|
|
508
517
|
outline_output = outline.to_s.split("\n", -1)
|
509
518
|
|
510
|
-
expect(outline_output).to eq(["#{
|
511
|
-
" #{
|
519
|
+
expect(outline_output).to eq(["#{OUTLINE_KEYWORD}:",
|
520
|
+
" #{STEP_KEYWORD} a step",
|
512
521
|
'',
|
513
|
-
"#{
|
522
|
+
"#{EXAMPLE_KEYWORD}:",
|
514
523
|
' | value |',
|
515
524
|
' | x |',
|
516
525
|
'',
|
517
|
-
"#{
|
526
|
+
"#{EXAMPLE_KEYWORD}:",
|
518
527
|
' | value |',
|
519
528
|
' | y |'])
|
520
529
|
end
|
521
530
|
|
522
531
|
it 'can output a outline that has everything' do
|
523
532
|
source = ['@tag1 @tag2 @tag3',
|
524
|
-
"#{
|
533
|
+
"#{OUTLINE_KEYWORD}: A outline with everything it could have",
|
525
534
|
'Including a description',
|
526
535
|
'and then some.',
|
527
|
-
"#{
|
536
|
+
"#{STEP_KEYWORD} a step",
|
528
537
|
'|value|',
|
529
|
-
"#{
|
538
|
+
"#{STEP_KEYWORD} another step",
|
530
539
|
'"""',
|
531
540
|
'some string',
|
532
541
|
'"""',
|
533
542
|
'',
|
534
|
-
"#{
|
543
|
+
"#{EXAMPLE_KEYWORD}:",
|
535
544
|
'',
|
536
545
|
'Some description.',
|
537
546
|
'Some more description.',
|
@@ -540,7 +549,7 @@ describe 'Outline, Integration' do
|
|
540
549
|
'| x |',
|
541
550
|
'',
|
542
551
|
'@example_tag',
|
543
|
-
"#{
|
552
|
+
"#{EXAMPLE_KEYWORD}:",
|
544
553
|
'| value |',
|
545
554
|
'| y |']
|
546
555
|
source = source.join("\n")
|
@@ -549,19 +558,19 @@ describe 'Outline, Integration' do
|
|
549
558
|
outline_output = outline.to_s.split("\n", -1)
|
550
559
|
|
551
560
|
expect(outline_output).to eq(['@tag1 @tag2 @tag3',
|
552
|
-
"#{
|
561
|
+
"#{OUTLINE_KEYWORD}: A outline with everything it could have",
|
553
562
|
'',
|
554
563
|
'Including a description',
|
555
564
|
'and then some.',
|
556
565
|
'',
|
557
|
-
" #{
|
566
|
+
" #{STEP_KEYWORD} a step",
|
558
567
|
' | value |',
|
559
|
-
" #{
|
568
|
+
" #{STEP_KEYWORD} another step",
|
560
569
|
' """',
|
561
570
|
' some string',
|
562
571
|
' """',
|
563
572
|
'',
|
564
|
-
"#{
|
573
|
+
"#{EXAMPLE_KEYWORD}:",
|
565
574
|
'',
|
566
575
|
'Some description.',
|
567
576
|
'Some more description.',
|
@@ -570,7 +579,7 @@ describe 'Outline, Integration' do
|
|
570
579
|
' | x |',
|
571
580
|
'',
|
572
581
|
'@example_tag',
|
573
|
-
"#{
|
582
|
+
"#{EXAMPLE_KEYWORD}:",
|
574
583
|
' | value |',
|
575
584
|
' | y |'])
|
576
585
|
end
|