cuke_modeler 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +51 -33
  3. data/CHANGELOG.md +13 -2
  4. data/Gemfile +9 -2
  5. data/appveyor.yml +29 -2
  6. data/cuke_modeler.gemspec +1 -1
  7. data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +1 -1
  8. data/lib/cuke_modeler/adapters/gherkin_5_adapter.rb +12 -0
  9. data/lib/cuke_modeler/adapters/gherkin_7_adapter.rb +307 -0
  10. data/lib/cuke_modeler/adapters/gherkin_8_adapter.rb +12 -0
  11. data/lib/cuke_modeler/adapters/gherkin_9_adapter.rb +12 -0
  12. data/lib/cuke_modeler/parsing.rb +116 -108
  13. data/lib/cuke_modeler/version.rb +1 -1
  14. data/testing/gemfiles/gherkin7.gemfile +9 -0
  15. data/testing/gemfiles/gherkin8.gemfile +9 -0
  16. data/testing/gemfiles/gherkin9.gemfile +9 -0
  17. data/testing/helper_methods.rb +23 -0
  18. data/testing/rspec/spec/integration/adapters/gherkin_2_adapter_spec.rb +1 -1
  19. data/testing/rspec/spec/integration/adapters/gherkin_3_adapter_spec.rb +1 -1
  20. data/testing/rspec/spec/integration/adapters/gherkin_4_adapter_spec.rb +1 -1
  21. data/testing/rspec/spec/integration/adapters/gherkin_5_adapter_spec.rb +165 -0
  22. data/testing/rspec/spec/integration/adapters/gherkin_6_adapter_spec.rb +1 -8
  23. data/testing/rspec/spec/integration/adapters/gherkin_7_adapter_spec.rb +162 -0
  24. data/testing/rspec/spec/integration/adapters/gherkin_8_adapter_spec.rb +162 -0
  25. data/testing/rspec/spec/integration/adapters/gherkin_9_adapter_spec.rb +162 -0
  26. data/testing/rspec/spec/integration/models/background_integration_spec.rb +19 -23
  27. data/testing/rspec/spec/integration/models/cell_integration_spec.rb +27 -24
  28. data/testing/rspec/spec/integration/models/comment_integration_spec.rb +26 -23
  29. data/testing/rspec/spec/integration/models/doc_string_integration_spec.rb +19 -23
  30. data/testing/rspec/spec/integration/models/example_integration_spec.rb +50 -38
  31. data/testing/rspec/spec/integration/models/feature_file_integration_spec.rb +32 -28
  32. data/testing/rspec/spec/integration/models/feature_integration_spec.rb +28 -23
  33. data/testing/rspec/spec/integration/models/outline_integration_spec.rb +39 -44
  34. data/testing/rspec/spec/integration/models/row_integration_spec.rb +35 -23
  35. data/testing/rspec/spec/integration/models/scenario_integration_spec.rb +19 -23
  36. data/testing/rspec/spec/integration/models/step_integration_spec.rb +51 -47
  37. data/testing/rspec/spec/integration/models/table_integration_spec.rb +19 -23
  38. data/testing/rspec/spec/integration/models/tag_integration_spec.rb +35 -23
  39. data/testing/rspec/spec/integration/parsing_integration_spec.rb +27 -6
  40. data/testing/rspec/spec/spec_helper.rb +39 -46
  41. metadata +16 -4
@@ -69,38 +69,43 @@ describe 'Feature, Integration' do
69
69
  expect(tag.parent_model).to equal(feature)
70
70
  end
71
71
 
72
- it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
73
- feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
74
- data = feature.parsing_data
72
+ describe 'parsing data' do
75
73
 
76
- expect(data.keys).to match_array([:tags, :location, :language, :keyword, :name, :children, :description])
77
- expect(data[:name]).to eq('test feature')
78
- end
74
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(6, 7, 8, 9) do
75
+ feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
76
+ data = feature.parsing_data
79
77
 
80
- it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
81
- feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
82
- data = feature.parsing_data
78
+ expect(data.keys).to match_array([:tags, :location, :language, :keyword, :name, :children, :description])
79
+ expect(data[:name]).to eq('test feature')
80
+ end
83
81
 
84
- expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :children, :description])
85
- expect(data[:type]).to eq(:Feature)
86
- end
82
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(4, 5) do
83
+ feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
84
+ data = feature.parsing_data
87
85
 
88
- it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
89
- feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
90
- data = feature.parsing_data
86
+ expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :children, :description])
87
+ expect(data[:type]).to eq(:Feature)
88
+ end
91
89
 
92
- expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :scenarioDefinitions, :comments, :background, :description])
93
- expect(data[:type]).to eq(:Feature)
94
- end
90
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(3) do
91
+ feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
92
+ data = feature.parsing_data
95
93
 
96
- it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
97
- feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
98
- data = feature.parsing_data
94
+ expect(data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :scenarioDefinitions, :comments, :background, :description])
95
+ expect(data[:type]).to eq(:Feature)
96
+ end
97
+
98
+ it 'stores the original data generated by the parsing adapter', :if => gherkin?(2) do
99
+ feature = clazz.new("@tag\n#{FEATURE_KEYWORD}: test feature\ndescription\n#{BACKGROUND_KEYWORD}:\n#{SCENARIO_KEYWORD}:")
100
+ data = feature.parsing_data
101
+
102
+ expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'uri', 'elements', 'tags'])
103
+ expect(data['keyword']).to eq('Feature')
104
+ end
99
105
 
100
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'uri', 'elements', 'tags'])
101
- expect(data['keyword']).to eq('Feature')
102
106
  end
103
107
 
108
+
104
109
  it 'trims whitespace from its source description' do
105
110
  source = ["#{FEATURE_KEYWORD}:",
106
111
  ' ',
@@ -14,26 +14,14 @@ describe 'Outline, Integration' do
14
14
 
15
15
  describe 'unique behavior' do
16
16
 
17
- it 'can be instantiated with the minimum viable Gherkin', :gherkin6 => true do
18
- source = "#{OUTLINE_KEYWORD}:"
19
-
20
- expect { clazz.new(source) }.to_not raise_error
21
- end
22
-
23
- it 'can be instantiated with the minimum viable Gherkin', :gherkin4_5 => true do
24
- source = "#{OUTLINE_KEYWORD}:"
25
-
26
- expect { clazz.new(source) }.to_not raise_error
27
- end
28
-
29
- it 'can be instantiated with the minimum viable Gherkin', :gherkin2 => true do
17
+ it 'can be instantiated with the minimum viable Gherkin', :unless => gherkin?(3) do
30
18
  source = "#{OUTLINE_KEYWORD}:"
31
19
 
32
20
  expect { clazz.new(source) }.to_not raise_error
33
21
  end
34
22
 
35
23
  # gherkin 3.x does not accept incomplete outlines
36
- it 'can be instantiated with the minimum viable Gherkin', :gherkin3 => true do
24
+ it 'can be instantiated with the minimum viable Gherkin', :if => gherkin?(3) do
37
25
  source = "#{OUTLINE_KEYWORD}:
38
26
  #{EXAMPLE_KEYWORD}:
39
27
  | param |
@@ -63,36 +51,32 @@ describe 'Outline, Integration' do
63
51
  end
64
52
  end
65
53
 
66
- it 'stores the original data generated by the parsing adapter', :gherkin6 => true do
67
- outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
68
- data = outline.parsing_data
54
+ describe 'parsing data' do
69
55
 
70
- expect(data.keys).to match_array([:background, :rule, :scenario])
71
- expect(data[:scenario][:name]).to eq('test outline')
72
- end
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
73
59
 
74
- it 'stores the original data generated by the parsing adapter', :gherkin4_5 => true do
75
- outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
76
- data = outline.parsing_data
60
+ expect(data.keys).to match_array([:background, :rule, :scenario])
61
+ expect(data[:scenario][:name]).to eq('test outline')
62
+ end
77
63
 
78
- expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :examples, :description])
79
- expect(data[:type]).to eq(:ScenarioOutline)
80
- end
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
81
67
 
82
- it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
83
- outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
84
- data = outline.parsing_data
68
+ expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :examples, :description])
69
+ expect(data[:type]).to eq(:ScenarioOutline)
70
+ end
85
71
 
86
- expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :examples, :description])
87
- expect(data[:type]).to eq(:ScenarioOutline)
88
- end
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
89
75
 
90
- it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
91
- outline = clazz.new("@tag\n#{OUTLINE_KEYWORD}: test outline\ndescription\n#{STEP_KEYWORD} a step\n#{EXAMPLE_KEYWORD}:\n|param|\n|value|")
92
- data = outline.parsing_data
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
93
79
 
94
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'examples', 'steps', 'tags'])
95
- expect(data['keyword']).to eq('Scenario Outline')
96
80
  end
97
81
 
98
82
  it 'provides a descriptive filename when being parsed from stand alone text' do
@@ -176,10 +160,21 @@ describe 'Outline, Integration' do
176
160
 
177
161
 
178
162
  # gherkin 3.x does not accept incomplete outlines
179
- it "models the outline's keyword", :gherkin3 => false do
163
+ it "models the outline's keyword", :unless => gherkin?(3) do
180
164
  expect(outline.keyword).to eq("#{OUTLINE_KEYWORD}")
181
165
  end
182
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
+
176
+ end
177
+
183
178
  it "models the outline's source line" do
184
179
  source_text = "#{FEATURE_KEYWORD}:
185
180
 
@@ -251,7 +246,7 @@ describe 'Outline, Integration' do
251
246
 
252
247
 
253
248
  # gherkin 3.x does not accept incomplete outlines
254
- context 'an empty outline', :gherkin3 => false do
249
+ context 'an empty outline', :unless => gherkin?(3) do
255
250
 
256
251
  let(:source_text) { "#{OUTLINE_KEYWORD}:" }
257
252
  let(:outline) { clazz.new(source_text) }
@@ -433,7 +428,7 @@ describe 'Outline, Integration' do
433
428
  context 'from source text' do
434
429
 
435
430
  # gherkin 3.x does not accept incomplete outlines
436
- it 'can output an empty outline', :gherkin3 => false do
431
+ it 'can output an empty outline', :unless => gherkin?(3) do
437
432
  source = ["#{OUTLINE_KEYWORD}:"]
438
433
  source = source.join("\n")
439
434
  outline = clazz.new(source)
@@ -444,7 +439,7 @@ describe 'Outline, Integration' do
444
439
  end
445
440
 
446
441
  # gherkin 3.x does not accept incomplete outlines
447
- it 'can output a outline that has a name', :gherkin3 => false do
442
+ it 'can output a outline that has a name', :unless => gherkin?(3) do
448
443
  source = ["#{OUTLINE_KEYWORD}: test outline"]
449
444
  source = source.join("\n")
450
445
  outline = clazz.new(source)
@@ -455,7 +450,7 @@ describe 'Outline, Integration' do
455
450
  end
456
451
 
457
452
  # gherkin 3.x does not accept incomplete outlines
458
- it 'can output a outline that has a description', :gherkin3 => false do
453
+ it 'can output a outline that has a description', :unless => gherkin?(3) do
459
454
  source = ["#{OUTLINE_KEYWORD}:",
460
455
  'Some description.',
461
456
  'Some more description.']
@@ -471,7 +466,7 @@ describe 'Outline, Integration' do
471
466
  end
472
467
 
473
468
  # gherkin 3.x does not accept incomplete outlines
474
- it 'can output a outline that has steps', :gherkin3 => false do
469
+ it 'can output a outline that has steps', :unless => gherkin?(3) do
475
470
  source = ["#{OUTLINE_KEYWORD}:",
476
471
  " #{STEP_KEYWORD} a step",
477
472
  ' | value |',
@@ -494,7 +489,7 @@ describe 'Outline, Integration' do
494
489
  end
495
490
 
496
491
  # gherkin 3.x does not accept incomplete outlines
497
- it 'can output a outline that has tags', :gherkin3 => false do
492
+ it 'can output a outline that has tags', :unless => gherkin?(3) do
498
493
  source = ['@tag1 @tag2',
499
494
  '@tag3',
500
495
  "#{OUTLINE_KEYWORD}:"]
@@ -44,36 +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', :gherkin6 => 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([:location, :cells])
52
- expect(data[:location][:line]).to eq(5)
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', :gherkin4_5 => 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', :gherkin3 => 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
66
64
 
67
- expect(data.keys).to match_array([:type, :location, :cells])
68
- expect(data[:type]).to eq('TableRow')
69
- end
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
70
84
 
71
- it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
72
- example_row = clazz.new("| a | row |")
73
- data = example_row.parsing_data
85
+ expect(data.keys).to match_array(['cells', 'line'])
86
+ expect(data['line']).to eq(5)
87
+ end
74
88
 
75
- expect(data.keys).to match_array(['cells', 'line'])
76
- expect(data['line']).to eq(5)
77
89
  end
78
90
 
79
91
  it 'properly sets its child models' do
@@ -43,36 +43,32 @@ describe 'Scenario, Integration' do
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', :gherkin6 => 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([:background, :rule, :scenario])
51
- expect(data[:scenario][:name]).to eq('test 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', :gherkin4_5 => 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', :gherkin3 => 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
65
63
 
66
- expect(data.keys).to match_array([:type, :tags, :location, :keyword, :name, :steps, :description])
67
- expect(data[:type]).to eq(:Scenario)
68
- end
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
69
67
 
70
- it 'stores the original data generated by the parsing adapter', :gherkin2 => true do
71
- scenario = clazz.new("@tag\n#{SCENARIO_KEYWORD}: test scenario\ndescription\n#{STEP_KEYWORD} a step")
72
- data = scenario.parsing_data
68
+ expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'steps', 'tags'])
69
+ expect(data['keyword']).to eq('Scenario')
70
+ end
73
71
 
74
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'description', 'id', 'type', 'steps', 'tags'])
75
- expect(data['keyword']).to eq('Scenario')
76
72
  end
77
73
 
78
74
  it 'properly sets its child models' do
@@ -43,68 +43,72 @@ describe 'Step, Integration' do
43
43
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_step\.feature'/)
44
44
  end
45
45
 
46
- it 'stores the original data generated by the parsing adapter (with a table)', :gherkin6 => true do
47
- step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
48
- data = step.parsing_data
46
+ describe 'parsing data' do
49
47
 
50
- expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
51
- expect(data[:text]).to eq('test step')
52
- end
48
+ it 'stores the original data generated by the parsing adapter (with a table)', :if => gherkin?(8, 9) do
49
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
50
+ data = step.parsing_data
53
51
 
54
- it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin6 => true do
55
- step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
56
- data = step.parsing_data
52
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string, :id])
53
+ expect(data[:text]).to eq('test step')
54
+ end
57
55
 
58
- expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
59
- expect(data[:text]).to eq('test step')
60
- end
56
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :if => gherkin?(8, 9) do
57
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
58
+ data = step.parsing_data
61
59
 
62
- it 'stores the original data generated by the parsing adapter (with a table)', :gherkin4_5 => true do
63
- step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
64
- data = step.parsing_data
60
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string, :id])
61
+ expect(data[:text]).to eq('test step')
62
+ end
65
63
 
66
- expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
67
- expect(data[:type]).to eq(:Step)
68
- end
64
+ it 'stores the original data generated by the parsing adapter (with a table)', :if => gherkin?(6, 7) do
65
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
66
+ data = step.parsing_data
69
67
 
70
- it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin4_5 => true do
71
- step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
72
- data = step.parsing_data
68
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
69
+ expect(data[:text]).to eq('test step')
70
+ end
73
71
 
74
- expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
75
- expect(data[:type]).to eq(:Step)
76
- end
72
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :if => gherkin?(6, 7) do
73
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
74
+ data = step.parsing_data
77
75
 
78
- it 'stores the original data generated by the parsing adapter (with a table)', :gherkin3 => true do
79
- step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
80
- data = step.parsing_data
76
+ expect(data.keys).to match_array([:location, :keyword, :text, :data_table, :doc_string])
77
+ expect(data[:text]).to eq('test step')
78
+ end
81
79
 
82
- expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
83
- expect(data[:type]).to eq(:Step)
84
- end
80
+ it 'stores the original data generated by the parsing adapter (with a table)', :if => gherkin?(3, 4, 5) do
81
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
82
+ data = step.parsing_data
85
83
 
86
- it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin3 => true do
87
- step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
88
- data = step.parsing_data
84
+ expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
85
+ expect(data[:type]).to eq(:Step)
86
+ end
89
87
 
90
- expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
91
- expect(data[:type]).to eq(:Step)
92
- end
88
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :if => gherkin?(3, 4, 5) do
89
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
90
+ data = step.parsing_data
93
91
 
94
- it 'stores the original data generated by the parsing adapter (with a table)', :gherkin2 => true do
95
- step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
96
- data = step.parsing_data
92
+ expect(data.keys).to match_array([:type, :location, :keyword, :text, :argument])
93
+ expect(data[:type]).to eq(:Step)
94
+ end
97
95
 
98
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'rows'])
99
- expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
100
- end
96
+ it 'stores the original data generated by the parsing adapter (with a table)', :if => gherkin?(2) do
97
+ step = clazz.new("#{STEP_KEYWORD} test step\n|table|")
98
+ data = step.parsing_data
101
99
 
102
- it 'stores the original data generated by the parsing adapter (with a doc string)', :gherkin2 => true do
103
- step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
104
- data = step.parsing_data
100
+ expect(data.keys).to match_array(['keyword', 'name', 'line', 'rows'])
101
+ expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
102
+ end
103
+
104
+ it 'stores the original data generated by the parsing adapter (with a doc string)', :if => gherkin?(2) do
105
+ step = clazz.new("#{STEP_KEYWORD} test step\n\"\"\"\na doc string\n\"\"\"")
106
+ data = step.parsing_data
107
+
108
+ expect(data.keys).to match_array(['keyword', 'name', 'line', 'doc_string'])
109
+ expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
110
+ end
105
111
 
106
- expect(data.keys).to match_array(['keyword', 'name', 'line', 'doc_string'])
107
- expect(data['keyword']).to eq("#{STEP_KEYWORD} ")
108
112
  end
109
113
 
110
114
  describe 'model population' do