cuke_modeler 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +12 -0
- data/lib/cuke_modeler/adapters/gherkin_2_adapter.rb +5 -5
- data/lib/cuke_modeler/adapters/gherkin_3_adapter.rb +8 -5
- data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +8 -5
- data/lib/cuke_modeler/containing.rb +12 -7
- data/lib/cuke_modeler/models/background.rb +7 -2
- data/lib/cuke_modeler/models/cell.rb +2 -1
- data/lib/cuke_modeler/models/doc_string.rb +2 -1
- data/lib/cuke_modeler/models/example.rb +8 -4
- data/lib/cuke_modeler/models/feature.rb +4 -1
- data/lib/cuke_modeler/models/outline.rb +6 -2
- data/lib/cuke_modeler/models/row.rb +2 -1
- data/lib/cuke_modeler/models/scenario.rb +7 -2
- data/lib/cuke_modeler/models/step.rb +2 -1
- data/lib/cuke_modeler/models/table.rb +2 -1
- data/lib/cuke_modeler/models/tag.rb +2 -1
- data/lib/cuke_modeler/parsing.rb +45 -0
- data/lib/cuke_modeler/version.rb +1 -1
- data/testing/cucumber/features/modeling/background_modeling.feature +7 -0
- data/testing/cucumber/features/modeling/background_output.feature +6 -1
- data/testing/cucumber/features/modeling/directory_output.feature +6 -1
- data/testing/cucumber/features/modeling/doc_string_output.feature +6 -1
- data/testing/cucumber/features/modeling/example_modeling.feature +7 -0
- data/testing/cucumber/features/modeling/example_output.feature +6 -1
- data/testing/cucumber/features/modeling/feature_file_output.feature +6 -1
- data/testing/cucumber/features/modeling/feature_modeling.feature +7 -0
- data/testing/cucumber/features/modeling/feature_output.feature +6 -1
- data/testing/cucumber/features/modeling/model_output.feature +1 -8
- data/testing/cucumber/features/modeling/outline_modeling.feature +7 -0
- data/testing/cucumber/features/modeling/outline_output.feature +6 -1
- data/testing/cucumber/features/modeling/row_output.feature +6 -1
- data/testing/cucumber/features/modeling/scenario_modeling.feature +7 -0
- data/testing/cucumber/features/modeling/scenario_output.feature +6 -1
- data/testing/cucumber/features/modeling/step_output.feature +6 -1
- data/testing/cucumber/features/modeling/table_output.feature +6 -1
- data/testing/cucumber/features/modeling/tag_output.feature +6 -1
- data/testing/cucumber/step_definitions/verification_steps.rb +21 -12
- data/testing/dialect_helper.rb +48 -0
- data/testing/rspec/spec/integration/background_integration_spec.rb +93 -88
- data/testing/rspec/spec/integration/cell_integration_spec.rb +26 -27
- data/testing/rspec/spec/integration/directory_integration_spec.rb +4 -4
- data/testing/rspec/spec/integration/doc_string_integration_spec.rb +38 -39
- data/testing/rspec/spec/integration/example_integration_spec.rb +97 -95
- data/testing/rspec/spec/integration/feature_file_integration_spec.rb +5 -5
- data/testing/rspec/spec/integration/feature_integration_spec.rb +157 -155
- data/testing/rspec/spec/integration/gherkin_2_adapter_spec.rb +17 -17
- data/testing/rspec/spec/integration/gherkin_3_adapter_spec.rb +17 -17
- data/testing/rspec/spec/integration/gherkin_4_adapter_spec.rb +17 -17
- data/testing/rspec/spec/integration/outline_integration_spec.rb +359 -354
- data/testing/rspec/spec/integration/parsing_integration_spec.rb +30 -2
- data/testing/rspec/spec/integration/row_integration_spec.rb +23 -25
- data/testing/rspec/spec/integration/scenario_integration_spec.rb +238 -235
- data/testing/rspec/spec/integration/step_integration_spec.rb +69 -64
- data/testing/rspec/spec/integration/table_integration_spec.rb +32 -36
- data/testing/rspec/spec/integration/tag_integration_spec.rb +26 -27
- data/testing/rspec/spec/spec_helper.rb +43 -0
- data/testing/rspec/spec/unit/background_unit_spec.rb +7 -0
- data/testing/rspec/spec/unit/example_unit_spec.rb +7 -0
- data/testing/rspec/spec/unit/feature_unit_spec.rb +7 -0
- data/testing/rspec/spec/unit/outline_unit_spec.rb +7 -0
- data/testing/rspec/spec/unit/parsing_unit_spec.rb +33 -0
- data/testing/rspec/spec/unit/scenario_unit_spec.rb +7 -0
- data/testing/rspec/spec/unit/shared/keyworded_models_unit_specs.rb +58 -0
- data/testing/rspec/spec/unit/step_unit_spec.rb +1 -23
- data/testing/test_languages.json +45 -0
- data/todo.txt +1 -1
- metadata +6 -3
@@ -30,7 +30,7 @@ describe 'FeatureFile, Integration' do
|
|
30
30
|
|
31
31
|
describe 'model population' do
|
32
32
|
|
33
|
-
let(:source_text) { "
|
33
|
+
let(:source_text) { "#{@feature_keyword}: Test feature" }
|
34
34
|
let(:feature_file_path) { "#{@default_file_directory}/#{@default_feature_file_name}" }
|
35
35
|
let(:feature_file) { clazz.new(feature_file_path) }
|
36
36
|
|
@@ -76,7 +76,7 @@ describe 'FeatureFile, Integration' do
|
|
76
76
|
file_path = "#{@default_file_directory}/#{@default_feature_file_name}"
|
77
77
|
|
78
78
|
File.open(file_path, "w") { |file|
|
79
|
-
file.puts(
|
79
|
+
file.puts("#{@feature_keyword}: Test feature")
|
80
80
|
}
|
81
81
|
|
82
82
|
file = clazz.new(file_path)
|
@@ -90,7 +90,7 @@ describe 'FeatureFile, Integration' do
|
|
90
90
|
|
91
91
|
before(:each) do
|
92
92
|
file_path = "#{@default_file_directory}/feature_file_test_file.feature"
|
93
|
-
File.open(file_path, 'w') { |file| file.write(
|
93
|
+
File.open(file_path, 'w') { |file| file.write("#{@feature_keyword}: Test feature") }
|
94
94
|
end
|
95
95
|
|
96
96
|
let(:directory) { CukeModeler::Directory.new(@default_file_directory) }
|
@@ -116,7 +116,7 @@ describe 'FeatureFile, Integration' do
|
|
116
116
|
|
117
117
|
context 'from source text' do
|
118
118
|
|
119
|
-
let(:source_text) { "
|
119
|
+
let(:source_text) { "#{@feature_keyword}: Test feature" }
|
120
120
|
let(:feature_file_path) { "#{@default_file_directory}/#{@default_feature_file_name}" }
|
121
121
|
let(:feature_file) { clazz.new(feature_file_path) }
|
122
122
|
|
@@ -135,7 +135,7 @@ describe 'FeatureFile, Integration' do
|
|
135
135
|
|
136
136
|
it 'can be remade from its own output' do
|
137
137
|
path = "#{@default_file_directory}/#{@default_feature_file_name}"
|
138
|
-
File.open(path, "w") { |file| file.puts "
|
138
|
+
File.open(path, "w") { |file| file.puts "#{@feature_keyword}:" }
|
139
139
|
|
140
140
|
source = path
|
141
141
|
feature_file = clazz.new(source)
|
@@ -16,7 +16,7 @@ describe 'Feature, Integration' do
|
|
16
16
|
describe 'unique behavior' do
|
17
17
|
|
18
18
|
it 'can be instantiated with the minimum viable Gherkin' do
|
19
|
-
source =
|
19
|
+
source = "#{@feature_keyword}:"
|
20
20
|
|
21
21
|
expect { clazz.new(source) }.to_not raise_error
|
22
22
|
end
|
@@ -28,15 +28,14 @@ describe 'Feature, Integration' do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'properly sets its child models' do
|
31
|
-
source =
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
source = source.join("\n")
|
31
|
+
source = "@a_tag
|
32
|
+
#{@feature_keyword}: Test feature
|
33
|
+
#{@background_keyword}: Test background
|
34
|
+
#{@scenario_keyword}: Test scenario
|
35
|
+
#{@outline_keyword}: Test outline
|
36
|
+
#{@example_keyword}: Test Examples
|
37
|
+
| param |
|
38
|
+
| value |"
|
40
39
|
|
41
40
|
|
42
41
|
feature = clazz.new(source)
|
@@ -53,7 +52,7 @@ describe 'Feature, Integration' do
|
|
53
52
|
end
|
54
53
|
|
55
54
|
it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
|
56
|
-
feature = clazz.new("@tag\
|
55
|
+
feature = clazz.new("@tag\n#{@feature_keyword}: test feature\ndescription\n#{@background_keyword}:\n#{@scenario_keyword}:")
|
57
56
|
data = feature.parsing_data
|
58
57
|
|
59
58
|
expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :children, :description])
|
@@ -61,7 +60,7 @@ describe 'Feature, Integration' do
|
|
61
60
|
end
|
62
61
|
|
63
62
|
it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
|
64
|
-
feature = clazz.new("@tag\
|
63
|
+
feature = clazz.new("@tag\n#{@feature_keyword}: test feature\ndescription\n#{@background_keyword}:\n#{@scenario_keyword}:")
|
65
64
|
data = feature.parsing_data
|
66
65
|
|
67
66
|
expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :scenarioDefinitions, :comments, :background, :description])
|
@@ -69,7 +68,7 @@ describe 'Feature, Integration' do
|
|
69
68
|
end
|
70
69
|
|
71
70
|
it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
|
72
|
-
feature = clazz.new("@tag\
|
71
|
+
feature = clazz.new("@tag\n#{@feature_keyword}: test feature\ndescription\n#{@background_keyword}:\n#{@scenario_keyword}:")
|
73
72
|
data = feature.parsing_data
|
74
73
|
|
75
74
|
expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'uri', 'elements', 'tags'])
|
@@ -77,7 +76,7 @@ describe 'Feature, Integration' do
|
|
77
76
|
end
|
78
77
|
|
79
78
|
it 'trims whitespace from its source description' do
|
80
|
-
source = [
|
79
|
+
source = ["#{@feature_keyword}:",
|
81
80
|
' ',
|
82
81
|
' description line 1',
|
83
82
|
'',
|
@@ -86,11 +85,11 @@ describe 'Feature, Integration' do
|
|
86
85
|
'',
|
87
86
|
'',
|
88
87
|
'',
|
89
|
-
|
88
|
+
" #{@scenario_keyword}:"]
|
90
89
|
source = source.join("\n")
|
91
90
|
|
92
91
|
feature = clazz.new(source)
|
93
|
-
description = feature.description.split("\n")
|
92
|
+
description = feature.description.split("\n", -1)
|
94
93
|
|
95
94
|
expect(description).to eq([' description line 1',
|
96
95
|
'',
|
@@ -113,8 +112,15 @@ describe 'Feature, Integration' do
|
|
113
112
|
|
114
113
|
context 'from source text' do
|
115
114
|
|
115
|
+
it "models the feature's keyword" do
|
116
|
+
source_text = "#{@feature_keyword}:"
|
117
|
+
feature = CukeModeler::Feature.new(source_text)
|
118
|
+
|
119
|
+
expect(feature.keyword).to eq(@feature_keyword)
|
120
|
+
end
|
121
|
+
|
116
122
|
it "models the feature's source line" do
|
117
|
-
source_text = "
|
123
|
+
source_text = "#{@feature_keyword}:"
|
118
124
|
feature = CukeModeler::Feature.new(source_text)
|
119
125
|
|
120
126
|
expect(feature.source_line).to eq(1)
|
@@ -123,34 +129,34 @@ describe 'Feature, Integration' do
|
|
123
129
|
|
124
130
|
context 'a filled feature' do
|
125
131
|
|
126
|
-
let(:source_text) {
|
127
|
-
|
132
|
+
let(:source_text) { "@tag_1 @tag_2
|
133
|
+
#{@feature_keyword}: Feature Foo
|
128
134
|
|
129
135
|
Some feature description.
|
130
136
|
|
131
137
|
Some more.
|
132
138
|
And some more.
|
133
139
|
|
134
|
-
|
135
|
-
|
140
|
+
#{@background_keyword}: The background
|
141
|
+
#{@step_keyword} some setup step
|
136
142
|
|
137
|
-
|
138
|
-
|
143
|
+
#{@scenario_keyword}: Scenario 1
|
144
|
+
#{@step_keyword} a step
|
139
145
|
|
140
|
-
|
141
|
-
|
142
|
-
|
146
|
+
#{@outline_keyword}: Outline 1
|
147
|
+
#{@step_keyword} a step
|
148
|
+
#{@example_keyword}:
|
143
149
|
| param |
|
144
150
|
| value |
|
145
151
|
|
146
|
-
|
147
|
-
|
152
|
+
#{@scenario_keyword}: Scenario 2
|
153
|
+
#{@step_keyword} a step
|
148
154
|
|
149
|
-
|
150
|
-
|
151
|
-
|
155
|
+
#{@outline_keyword}: Outline 2
|
156
|
+
#{@step_keyword} a step
|
157
|
+
#{@example_keyword}:
|
152
158
|
| param |
|
153
|
-
| value |
|
159
|
+
| value |" }
|
154
160
|
let(:feature) { clazz.new(source_text) }
|
155
161
|
|
156
162
|
|
@@ -159,7 +165,7 @@ describe 'Feature, Integration' do
|
|
159
165
|
end
|
160
166
|
|
161
167
|
it "models the feature's description" do
|
162
|
-
description = feature.description.split("\n")
|
168
|
+
description = feature.description.split("\n", -1)
|
163
169
|
|
164
170
|
expect(description).to eq([' Some feature description.',
|
165
171
|
'',
|
@@ -194,7 +200,7 @@ describe 'Feature, Integration' do
|
|
194
200
|
|
195
201
|
context 'an empty feature' do
|
196
202
|
|
197
|
-
let(:source_text) {
|
203
|
+
let(:source_text) { "#{@feature_keyword}:" }
|
198
204
|
let(:feature) { clazz.new(source_text) }
|
199
205
|
|
200
206
|
|
@@ -230,18 +236,16 @@ describe 'Feature, Integration' do
|
|
230
236
|
|
231
237
|
|
232
238
|
it 'knows how many test cases it has' do
|
233
|
-
source_1 =
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
' |value_2|']
|
244
|
-
source_2 = source_2.join("\n")
|
239
|
+
source_1 = "#{@feature_keyword}: Test feature"
|
240
|
+
|
241
|
+
source_2 = "#{@feature_keyword}: Test feature
|
242
|
+
#{@scenario_keyword}: Test scenario
|
243
|
+
#{@outline_keyword}: Test outline
|
244
|
+
#{@step_keyword} a step
|
245
|
+
#{@example_keyword}: Test examples
|
246
|
+
|param|
|
247
|
+
|value_1|
|
248
|
+
|value_2|"
|
245
249
|
|
246
250
|
feature_1 = clazz.new(source_1)
|
247
251
|
feature_2 = clazz.new(source_2)
|
@@ -255,8 +259,7 @@ describe 'Feature, Integration' do
|
|
255
259
|
describe 'getting ancestors' do
|
256
260
|
|
257
261
|
before(:each) do
|
258
|
-
source =
|
259
|
-
source = source.join("\n")
|
262
|
+
source = "#{@feature_keyword}: Test feature"
|
260
263
|
|
261
264
|
file_path = "#{@default_file_directory}/feature_test_file.feature"
|
262
265
|
File.open(file_path, 'w') { |file| file.write(source) }
|
@@ -290,55 +293,54 @@ describe 'Feature, Integration' do
|
|
290
293
|
describe 'feature output' do
|
291
294
|
|
292
295
|
it 'can be remade from its own output' do
|
293
|
-
source =
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
source = source.join(" \n")
|
296
|
+
source = "@tag1 @tag2 @tag3
|
297
|
+
#{@feature_keyword}: A feature with everything it could have
|
298
|
+
|
299
|
+
Including a description
|
300
|
+
and then some.
|
301
|
+
|
302
|
+
#{@background_keyword}:
|
303
|
+
|
304
|
+
Background
|
305
|
+
description
|
306
|
+
|
307
|
+
#{@step_keyword} a step
|
308
|
+
| value1 |
|
309
|
+
#{@step_keyword} another step
|
310
|
+
|
311
|
+
@scenario_tag
|
312
|
+
#{@scenario_keyword}:
|
313
|
+
|
314
|
+
Scenario
|
315
|
+
description
|
316
|
+
|
317
|
+
#{@step_keyword} a step
|
318
|
+
#{@step_keyword} another step
|
319
|
+
\"\"\"
|
320
|
+
some text
|
321
|
+
\"\"\"
|
322
|
+
|
323
|
+
@outline_tag
|
324
|
+
#{@outline_keyword}:
|
325
|
+
|
326
|
+
Outline
|
327
|
+
description
|
328
|
+
|
329
|
+
#{@step_keyword} a step
|
330
|
+
| value2 |
|
331
|
+
#{@step_keyword} another step
|
332
|
+
\"\"\"
|
333
|
+
some text
|
334
|
+
\"\"\"
|
335
|
+
|
336
|
+
@example_tag
|
337
|
+
#{@example_keyword}:
|
338
|
+
|
339
|
+
Example
|
340
|
+
description
|
341
|
+
|
342
|
+
| param |
|
343
|
+
| value |"
|
342
344
|
feature = clazz.new(source)
|
343
345
|
|
344
346
|
feature_output = feature.to_s
|
@@ -351,35 +353,35 @@ describe 'Feature, Integration' do
|
|
351
353
|
context 'from source text' do
|
352
354
|
|
353
355
|
it 'can output an empty feature' do
|
354
|
-
source = [
|
356
|
+
source = ["#{@feature_keyword}:"]
|
355
357
|
source = source.join("\n")
|
356
358
|
feature = clazz.new(source)
|
357
359
|
|
358
|
-
feature_output = feature.to_s.split("\n")
|
360
|
+
feature_output = feature.to_s.split("\n", -1)
|
359
361
|
|
360
|
-
expect(feature_output).to eq([
|
362
|
+
expect(feature_output).to eq(["#{@feature_keyword}:"])
|
361
363
|
end
|
362
364
|
|
363
365
|
it 'can output a feature that has a name' do
|
364
|
-
source = [
|
366
|
+
source = ["#{@feature_keyword}: test feature"]
|
365
367
|
source = source.join("\n")
|
366
368
|
feature = clazz.new(source)
|
367
369
|
|
368
|
-
feature_output = feature.to_s.split("\n")
|
370
|
+
feature_output = feature.to_s.split("\n", -1)
|
369
371
|
|
370
|
-
expect(feature_output).to eq([
|
372
|
+
expect(feature_output).to eq(["#{@feature_keyword}: test feature"])
|
371
373
|
end
|
372
374
|
|
373
375
|
it 'can output a feature that has a description' do
|
374
|
-
source = [
|
376
|
+
source = ["#{@feature_keyword}:",
|
375
377
|
'Some description.',
|
376
378
|
'Some more description.']
|
377
379
|
source = source.join("\n")
|
378
380
|
feature = clazz.new(source)
|
379
381
|
|
380
|
-
feature_output = feature.to_s.split("\n")
|
382
|
+
feature_output = feature.to_s.split("\n", -1)
|
381
383
|
|
382
|
-
expect(feature_output).to eq([
|
384
|
+
expect(feature_output).to eq(["#{@feature_keyword}:",
|
383
385
|
'',
|
384
386
|
'Some description.',
|
385
387
|
'Some more description.'])
|
@@ -388,100 +390,100 @@ describe 'Feature, Integration' do
|
|
388
390
|
it 'can output a feature that has tags' do
|
389
391
|
source = ['@tag1 @tag2',
|
390
392
|
'@tag3',
|
391
|
-
|
393
|
+
"#{@feature_keyword}:"]
|
392
394
|
source = source.join("\n")
|
393
395
|
feature = clazz.new(source)
|
394
396
|
|
395
|
-
feature_output = feature.to_s.split("\n")
|
397
|
+
feature_output = feature.to_s.split("\n", -1)
|
396
398
|
|
397
399
|
expect(feature_output).to eq(['@tag1 @tag2 @tag3',
|
398
|
-
|
400
|
+
"#{@feature_keyword}:"])
|
399
401
|
end
|
400
402
|
|
401
403
|
it 'can output a feature that has a background' do
|
402
|
-
source = [
|
403
|
-
|
404
|
-
|
404
|
+
source = ["#{@feature_keyword}:",
|
405
|
+
"#{@background_keyword}:",
|
406
|
+
"#{@step_keyword} a step"]
|
405
407
|
source = source.join("\n")
|
406
408
|
feature = clazz.new(source)
|
407
409
|
|
408
|
-
feature_output = feature.to_s.split("\n")
|
410
|
+
feature_output = feature.to_s.split("\n", -1)
|
409
411
|
|
410
|
-
expect(feature_output).to eq([
|
412
|
+
expect(feature_output).to eq(["#{@feature_keyword}:",
|
411
413
|
'',
|
412
|
-
|
413
|
-
|
414
|
+
" #{@background_keyword}:",
|
415
|
+
" #{@step_keyword} a step"])
|
414
416
|
end
|
415
417
|
|
416
418
|
it 'can output a feature that has a scenario' do
|
417
|
-
source = [
|
418
|
-
|
419
|
-
|
419
|
+
source = ["#{@feature_keyword}:",
|
420
|
+
"#{@scenario_keyword}:",
|
421
|
+
"#{@step_keyword} a step"]
|
420
422
|
source = source.join("\n")
|
421
423
|
feature = clazz.new(source)
|
422
424
|
|
423
|
-
feature_output = feature.to_s.split("\n")
|
425
|
+
feature_output = feature.to_s.split("\n", -1)
|
424
426
|
|
425
|
-
expect(feature_output).to eq([
|
427
|
+
expect(feature_output).to eq(["#{@feature_keyword}:",
|
426
428
|
'',
|
427
|
-
|
428
|
-
|
429
|
+
" #{@scenario_keyword}:",
|
430
|
+
" #{@step_keyword} a step"])
|
429
431
|
end
|
430
432
|
|
431
433
|
it 'can output a feature that has an outline' do
|
432
|
-
source = [
|
433
|
-
|
434
|
-
|
435
|
-
|
434
|
+
source = ["#{@feature_keyword}:",
|
435
|
+
"#{@outline_keyword}:",
|
436
|
+
"#{@step_keyword} a step",
|
437
|
+
"#{@example_keyword}:",
|
436
438
|
'|param|',
|
437
439
|
'|value|']
|
438
440
|
source = source.join("\n")
|
439
441
|
feature = clazz.new(source)
|
440
442
|
|
441
|
-
feature_output = feature.to_s.split("\n")
|
443
|
+
feature_output = feature.to_s.split("\n", -1)
|
442
444
|
|
443
|
-
expect(feature_output).to eq([
|
445
|
+
expect(feature_output).to eq(["#{@feature_keyword}:",
|
444
446
|
'',
|
445
|
-
|
446
|
-
|
447
|
+
" #{@outline_keyword}:",
|
448
|
+
" #{@step_keyword} a step",
|
447
449
|
'',
|
448
|
-
|
450
|
+
" #{@example_keyword}:",
|
449
451
|
' | param |',
|
450
452
|
' | value |'])
|
451
453
|
end
|
452
454
|
|
453
455
|
it 'can output a feature that has everything' do
|
454
456
|
source = ['@tag1 @tag2 @tag3',
|
455
|
-
|
457
|
+
"#{@feature_keyword}: A feature with everything it could have",
|
456
458
|
'Including a description',
|
457
459
|
'and then some.',
|
458
|
-
|
460
|
+
"#{@background_keyword}:",
|
459
461
|
'Background',
|
460
462
|
'description',
|
461
|
-
|
463
|
+
"#{@step_keyword} a step",
|
462
464
|
'|value1|',
|
463
|
-
|
465
|
+
"#{@step_keyword} another step",
|
464
466
|
'@scenario_tag',
|
465
|
-
|
467
|
+
"#{@scenario_keyword}:",
|
466
468
|
'Scenario',
|
467
469
|
'description',
|
468
|
-
|
469
|
-
|
470
|
+
"#{@step_keyword} a step",
|
471
|
+
"#{@step_keyword} another step",
|
470
472
|
'"""',
|
471
473
|
'some text',
|
472
474
|
'"""',
|
473
475
|
'@outline_tag',
|
474
|
-
|
476
|
+
"#{@outline_keyword}:",
|
475
477
|
'Outline ',
|
476
478
|
'description',
|
477
|
-
|
479
|
+
"#{@step_keyword} a step ",
|
478
480
|
'|value2|',
|
479
|
-
|
481
|
+
"#{@step_keyword} another step",
|
480
482
|
'"""',
|
481
483
|
'some text',
|
482
484
|
'"""',
|
483
485
|
'@example_tag',
|
484
|
-
|
486
|
+
"#{@example_keyword}:",
|
485
487
|
'Example',
|
486
488
|
'description',
|
487
489
|
'|param|',
|
@@ -489,50 +491,50 @@ describe 'Feature, Integration' do
|
|
489
491
|
source = source.join("\n")
|
490
492
|
feature = clazz.new(source)
|
491
493
|
|
492
|
-
feature_output = feature.to_s.split("\n")
|
494
|
+
feature_output = feature.to_s.split("\n", -1)
|
493
495
|
|
494
496
|
expect(feature_output).to eq(['@tag1 @tag2 @tag3',
|
495
|
-
|
497
|
+
"#{@feature_keyword}: A feature with everything it could have",
|
496
498
|
'',
|
497
499
|
'Including a description',
|
498
500
|
'and then some.',
|
499
501
|
'',
|
500
|
-
|
502
|
+
" #{@background_keyword}:",
|
501
503
|
'',
|
502
504
|
' Background',
|
503
505
|
' description',
|
504
506
|
'',
|
505
|
-
|
507
|
+
" #{@step_keyword} a step",
|
506
508
|
' | value1 |',
|
507
|
-
|
509
|
+
" #{@step_keyword} another step",
|
508
510
|
'',
|
509
511
|
' @scenario_tag',
|
510
|
-
|
512
|
+
" #{@scenario_keyword}:",
|
511
513
|
'',
|
512
514
|
' Scenario',
|
513
515
|
' description',
|
514
516
|
'',
|
515
|
-
|
516
|
-
|
517
|
+
" #{@step_keyword} a step",
|
518
|
+
" #{@step_keyword} another step",
|
517
519
|
' """',
|
518
520
|
' some text',
|
519
521
|
' """',
|
520
522
|
'',
|
521
523
|
' @outline_tag',
|
522
|
-
|
524
|
+
" #{@outline_keyword}:",
|
523
525
|
'',
|
524
526
|
' Outline',
|
525
527
|
' description',
|
526
528
|
'',
|
527
|
-
|
529
|
+
" #{@step_keyword} a step",
|
528
530
|
' | value2 |',
|
529
|
-
|
531
|
+
" #{@step_keyword} another step",
|
530
532
|
' """',
|
531
533
|
' some text',
|
532
534
|
' """',
|
533
535
|
'',
|
534
536
|
' @example_tag',
|
535
|
-
|
537
|
+
" #{@example_keyword}:",
|
536
538
|
'',
|
537
539
|
' Example',
|
538
540
|
' description',
|