cuke_modeler 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +3 -0
  3. data/Gemfile +2 -1
  4. data/History.rdoc +9 -2
  5. data/Rakefile +10 -1
  6. data/cuke_modeler.gemspec +1 -1
  7. data/features/modeling/gherkin4/background_modeling.feature +64 -0
  8. data/features/modeling/gherkin4/background_output.feature +131 -0
  9. data/features/modeling/gherkin4/directory_modeling.feature +110 -0
  10. data/features/modeling/gherkin4/directory_output.feature +14 -0
  11. data/features/modeling/gherkin4/doc_string_modeling.feature +53 -0
  12. data/features/modeling/gherkin4/doc_string_output.feature +72 -0
  13. data/features/modeling/gherkin4/example_modeling.feature +100 -0
  14. data/features/modeling/gherkin4/example_output.feature +193 -0
  15. data/features/modeling/gherkin4/feature_file_modeling.feature +54 -0
  16. data/features/modeling/gherkin4/feature_file_output.feature +14 -0
  17. data/features/modeling/gherkin4/feature_modeling.feature +153 -0
  18. data/features/modeling/gherkin4/feature_output.feature +245 -0
  19. data/features/modeling/gherkin4/outline_modeling.feature +89 -0
  20. data/features/modeling/gherkin4/outline_output.feature +198 -0
  21. data/features/modeling/gherkin4/row_modeling.feature +68 -0
  22. data/features/modeling/gherkin4/row_output.feature +28 -0
  23. data/features/modeling/gherkin4/scenario_modeling.feature +78 -0
  24. data/features/modeling/gherkin4/scenario_output.feature +148 -0
  25. data/features/modeling/gherkin4/step_modeling.feature +75 -0
  26. data/features/modeling/gherkin4/step_output.feature +53 -0
  27. data/features/modeling/gherkin4/table_modeling.feature +42 -0
  28. data/features/modeling/gherkin4/table_output.feature +43 -0
  29. data/features/modeling/gherkin4/table_row_modeling.feature +57 -0
  30. data/features/modeling/gherkin4/table_row_output.feature +28 -0
  31. data/features/modeling/gherkin4/tag_modeling.feature +48 -0
  32. data/features/modeling/gherkin4/tag_output.feature +17 -0
  33. data/features/step_definitions/background_steps.rb +1 -1
  34. data/features/step_definitions/doc_string_steps.rb +1 -1
  35. data/features/step_definitions/feature_steps.rb +7 -4
  36. data/features/step_definitions/outline_steps.rb +2 -2
  37. data/features/step_definitions/step_steps.rb +2 -2
  38. data/features/step_definitions/table_steps.rb +1 -1
  39. data/features/step_definitions/tag_steps.rb +3 -3
  40. data/features/step_definitions/test_steps.rb +1 -1
  41. data/gemfiles/gherkin.gemfile +1 -0
  42. data/gemfiles/gherkin3.gemfile +2 -1
  43. data/gemfiles/gherkin4.gemfile +16 -0
  44. data/lib/cuke_modeler/adapters/gherkin_4_adapter.rb +220 -0
  45. data/lib/cuke_modeler/example.rb +1 -1
  46. data/lib/cuke_modeler/parsing.rb +73 -44
  47. data/lib/cuke_modeler/version.rb +1 -1
  48. data/spec/spec_helper.rb +10 -4
  49. data/spec/unit/background_unit_spec.rb +17 -9
  50. data/spec/unit/bare_bones_unit_specs.rb +3 -1
  51. data/spec/unit/containing_element_unit_specs.rb +3 -1
  52. data/spec/unit/directory_unit_spec.rb +5 -5
  53. data/spec/unit/doc_string_unit_spec.rb +13 -5
  54. data/spec/unit/example_unit_spec.rb +44 -9
  55. data/spec/unit/feature_element_unit_spec.rb +5 -5
  56. data/spec/unit/feature_element_unit_specs.rb +3 -1
  57. data/spec/unit/feature_file_unit_spec.rb +5 -5
  58. data/spec/unit/feature_unit_spec.rb +17 -9
  59. data/spec/unit/nested_element_unit_specs.rb +3 -1
  60. data/spec/unit/outline_unit_spec.rb +18 -10
  61. data/spec/unit/parsing_unit_spec.rb +2 -2
  62. data/spec/unit/prepopulated_unit_specs.rb +3 -1
  63. data/spec/unit/raw_element_unit_specs.rb +3 -1
  64. data/spec/unit/row_unit_spec.rb +15 -8
  65. data/spec/unit/scenario_unit_spec.rb +19 -11
  66. data/spec/unit/sourced_element_unit_specs.rb +3 -1
  67. data/spec/unit/step_unit_spec.rb +14 -6
  68. data/spec/unit/table_row_unit_spec.rb +15 -8
  69. data/spec/unit/table_unit_spec.rb +13 -5
  70. data/spec/unit/tag_unit_spec.rb +14 -6
  71. data/spec/unit/tagged_element_unit_specs.rb +3 -1
  72. data/spec/unit/test_element_unit_spec.rb +6 -6
  73. data/spec/unit/test_element_unit_specs.rb +3 -1
  74. metadata +86 -55
@@ -123,7 +123,7 @@ module CukeModeler
123
123
  end
124
124
 
125
125
  def populate_example_parameters
126
- @parameters = @row_elements.first.cells
126
+ @parameters = @row_elements.first.cells unless @row_elements.empty?
127
127
  end
128
128
 
129
129
  def populate_example_rows
@@ -6,79 +6,108 @@ rescue LoadError => e
6
6
  end
7
7
 
8
8
  # Parsing will be with an 'adapter' appropriate to the version of the 'gherkin' gem that has been activated
9
- if Gem.loaded_specs['gherkin'].version.version[/^3/]
9
+ case
10
+ when Gem.loaded_specs['gherkin'].version.version[/^4/]
10
11
 
11
- require 'gherkin/parser'
12
- require 'cuke_modeler/adapters/gherkin_3_adapter'
12
+ require 'gherkin/parser'
13
+ require 'cuke_modeler/adapters/gherkin_4_adapter'
14
+
15
+
16
+ module CukeModeler
13
17
 
18
+ module Parsing
19
+ class << self
14
20
 
15
- module CukeModeler
21
+ def parse_text(source_text, filename = 'cuke_modeler_fake_file.feature')
22
+ raise(ArgumentError, "Cannot parse #{source_text.class} objects. Strings only.") unless source_text.is_a?(String)
16
23
 
17
- module Parsing
18
- class << self
24
+ begin
25
+ parsed_result = Gherkin::Parser.new.parse(source_text)
26
+ rescue => e
27
+ raise(ArgumentError, "Error encountered while parsing '#{filename}'\n#{e.class} - #{e.message}")
28
+ end
19
29
 
20
- def parse_text(source_text, filename = 'cuke_modeler_fake_file.feature')
21
- raise(ArgumentError, "Cannot parse #{source_text.class} objects. Strings only.") unless source_text.is_a?(String)
30
+ adapted_result = CukeModeler::Gherkin4Adapter.new.adapt(parsed_result)
22
31
 
23
- begin
24
- parsed_result = Gherkin::Parser.new.parse(source_text)
25
- rescue => e
26
- raise(ArgumentError, "Error encountered while parsing '#{filename}'\n#{e.class} - #{e.message}")
32
+ adapted_result
27
33
  end
34
+ end
35
+ end
36
+ end
37
+
38
+ when Gem.loaded_specs['gherkin'].version.version[/^3/]
39
+
40
+ require 'gherkin/parser'
41
+ require 'cuke_modeler/adapters/gherkin_3_adapter'
42
+
43
+
44
+ module CukeModeler
28
45
 
29
- adapted_result = CukeModeler::Gherkin3Adapter.new.adapt(parsed_result)
46
+ module Parsing
47
+ class << self
30
48
 
31
- adapted_result
49
+ def parse_text(source_text, filename = 'cuke_modeler_fake_file.feature')
50
+ raise(ArgumentError, "Cannot parse #{source_text.class} objects. Strings only.") unless source_text.is_a?(String)
51
+
52
+ begin
53
+ parsed_result = Gherkin::Parser.new.parse(source_text)
54
+ rescue => e
55
+ raise(ArgumentError, "Error encountered while parsing '#{filename}'\n#{e.class} - #{e.message}")
56
+ end
57
+
58
+ adapted_result = CukeModeler::Gherkin3Adapter.new.adapt(parsed_result)
59
+
60
+ adapted_result
61
+ end
32
62
  end
33
63
  end
34
64
  end
35
- end
36
65
 
37
- else
66
+ else
38
67
 
39
- require 'stringio'
40
- require 'gherkin/formatter/json_formatter'
41
- require 'gherkin'
42
- require 'json'
43
- require 'multi_json'
44
- require 'cuke_modeler/adapters/gherkin_2_adapter'
68
+ require 'stringio'
69
+ require 'gherkin/formatter/json_formatter'
70
+ require 'gherkin'
71
+ require 'json'
72
+ require 'multi_json'
73
+ require 'cuke_modeler/adapters/gherkin_2_adapter'
45
74
 
46
75
 
47
- module CukeModeler
76
+ module CukeModeler
48
77
 
49
- # A module providing source text parsing functionality.
78
+ # A module providing source text parsing functionality.
50
79
 
51
- module Parsing
80
+ module Parsing
52
81
 
53
- class << self
82
+ class << self
54
83
 
55
- # Parses the Cucumber feature given in *source_text* and returns an array
56
- # containing the hash representation of its logical structure.
57
- def parse_text(source_text, filename = 'cuke_modeler_fake_file.feature')
58
- raise(ArgumentError, "Cannot parse #{source_text.class} objects. Strings only.") unless source_text.is_a?(String)
84
+ # Parses the Cucumber feature given in *source_text* and returns an array
85
+ # containing the hash representation of its logical structure.
86
+ def parse_text(source_text, filename = 'cuke_modeler_fake_file.feature')
87
+ raise(ArgumentError, "Cannot parse #{source_text.class} objects. Strings only.") unless source_text.is_a?(String)
59
88
 
60
- io = StringIO.new
61
- formatter = Gherkin::Formatter::JSONFormatter.new(io)
62
- parser = Gherkin::Parser::Parser.new(formatter)
89
+ io = StringIO.new
90
+ formatter = Gherkin::Formatter::JSONFormatter.new(io)
91
+ parser = Gherkin::Parser::Parser.new(formatter)
63
92
 
64
- begin
65
- parser.parse(source_text, filename, 0)
66
- rescue => e
67
- raise(ArgumentError, "Error encountered while parsing '#{filename}'\n#{e.class} - #{e.message}")
68
- end
93
+ begin
94
+ parser.parse(source_text, filename, 0)
95
+ rescue => e
96
+ raise(ArgumentError, "Error encountered while parsing '#{filename}'\n#{e.class} - #{e.message}")
97
+ end
98
+
99
+ formatter.done
69
100
 
70
- formatter.done
71
101
 
102
+ parsed_result = MultiJson.load(io.string)
103
+ adapted_result = CukeModeler::Gherkin2Adapter.new.adapt(parsed_result)
72
104
 
73
- parsed_result = MultiJson.load(io.string)
74
- adapted_result = CukeModeler::Gherkin2Adapter.new.adapt(parsed_result)
105
+ adapted_result
106
+ end
75
107
 
76
- adapted_result
77
108
  end
78
109
 
79
110
  end
80
-
81
111
  end
82
- end
83
112
 
84
113
  end
@@ -1,3 +1,3 @@
1
1
  module CukeModeler
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -14,10 +14,16 @@ require "#{File.dirname(__FILE__)}/unit/sourced_element_unit_specs"
14
14
  require "#{File.dirname(__FILE__)}/unit/raw_element_unit_specs"
15
15
 
16
16
  RSpec.configure do |config|
17
- if Gem.loaded_specs['gherkin'].version.version[/^3/]
18
- config.filter_run_excluding :gherkin2 => true
19
- else
20
- config.filter_run_excluding :gherkin3 => true
17
+ case
18
+ when Gem.loaded_specs['gherkin'].version.version[/^4/]
19
+ config.filter_run_excluding :gherkin2 => true,
20
+ :gherkin3 => true
21
+ when Gem.loaded_specs['gherkin'].version.version[/^3/]
22
+ config.filter_run_excluding :gherkin2 => true,
23
+ :gherkin4 => true
24
+ else
25
+ config.filter_run_excluding :gherkin3 => true,
26
+ :gherkin4 => true
21
27
  end
22
28
 
23
29
  config.before(:all) do
@@ -4,16 +4,16 @@ SimpleCov.command_name('Background') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'Background, Unit' do
6
6
 
7
- clazz = CukeModeler::Background
7
+ let(:clazz) { CukeModeler::Background }
8
8
 
9
- it_should_behave_like 'a feature element', clazz
10
- it_should_behave_like 'a nested element', clazz
11
- it_should_behave_like 'a containing element', clazz
12
- it_should_behave_like 'a bare bones element', clazz
13
- it_should_behave_like 'a prepopulated element', clazz
14
- it_should_behave_like 'a test element', clazz
15
- it_should_behave_like 'a sourced element', clazz
16
- it_should_behave_like 'a raw element', clazz
9
+ it_should_behave_like 'a feature element'
10
+ it_should_behave_like 'a nested element'
11
+ it_should_behave_like 'a containing element'
12
+ it_should_behave_like 'a bare bones element'
13
+ it_should_behave_like 'a prepopulated element'
14
+ it_should_behave_like 'a test element'
15
+ it_should_behave_like 'a sourced element'
16
+ it_should_behave_like 'a raw element'
17
17
 
18
18
  it 'can be parsed from stand alone text' do
19
19
  source = 'Background: test background'
@@ -30,6 +30,14 @@ describe 'Background, Unit' do
30
30
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_background\.feature'/)
31
31
  end
32
32
 
33
+ it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
34
+ background = clazz.new('Background: test background')
35
+ raw_data = background.raw_element
36
+
37
+ expect(raw_data.keys).to match_array([:type, :location, :keyword, :name, :steps])
38
+ expect(raw_data[:type]).to eq(:Background)
39
+ end
40
+
33
41
  it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
34
42
  background = clazz.new('Background: test background')
35
43
  raw_data = background.raw_element
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- shared_examples_for 'a bare bones element' do |clazz|
3
+ shared_examples_for 'a bare bones element' do
4
+
5
+ # clazz must be defined by the calling file
4
6
 
5
7
  before(:each) do
6
8
  @element = clazz.new
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- shared_examples_for 'a containing element' do |clazz|
3
+ shared_examples_for 'a containing element' do
4
+
5
+ # clazz must be defined by the calling file
4
6
 
5
7
  before(:each) do
6
8
  @element = clazz.new
@@ -4,12 +4,12 @@ SimpleCov.command_name('Directory') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'Directory, Unit' do
6
6
 
7
- clazz = CukeModeler::Directory
7
+ let(:clazz) { CukeModeler::Directory }
8
8
 
9
- it_should_behave_like 'a nested element', clazz
10
- it_should_behave_like 'a containing element', clazz
11
- it_should_behave_like 'a bare bones element', clazz
12
- it_should_behave_like 'a prepopulated element', clazz
9
+ it_should_behave_like 'a nested element'
10
+ it_should_behave_like 'a containing element'
11
+ it_should_behave_like 'a bare bones element'
12
+ it_should_behave_like 'a prepopulated element'
13
13
 
14
14
  before(:each) do
15
15
  @directory = clazz.new
@@ -4,12 +4,12 @@ SimpleCov.command_name('DocString') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'DocString, Unit' do
6
6
 
7
- clazz = CukeModeler::DocString
7
+ let(:clazz) { CukeModeler::DocString }
8
8
 
9
- it_should_behave_like 'a nested element', clazz
10
- it_should_behave_like 'a bare bones element', clazz
11
- it_should_behave_like 'a prepopulated element', clazz
12
- it_should_behave_like 'a raw element', clazz
9
+ it_should_behave_like 'a nested element'
10
+ it_should_behave_like 'a bare bones element'
11
+ it_should_behave_like 'a prepopulated element'
12
+ it_should_behave_like 'a raw element'
13
13
 
14
14
  it 'can be parsed from stand alone text' do
15
15
  source = "\"\"\"\nsome doc string\n\"\"\""
@@ -28,6 +28,14 @@ describe 'DocString, Unit' do
28
28
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_doc_string\.feature'/)
29
29
  end
30
30
 
31
+ it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
32
+ doc_string = clazz.new("\"\"\"\nsome doc string\n\"\"\"")
33
+ raw_data = doc_string.raw_element
34
+
35
+ expect(raw_data.keys).to match_array([:type, :location, :content])
36
+ expect(raw_data[:type]).to eq(:DocString)
37
+ end
38
+
31
39
  it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
32
40
  doc_string = clazz.new("\"\"\"\nsome doc string\n\"\"\"")
33
41
  raw_data = doc_string.raw_element
@@ -4,16 +4,16 @@ SimpleCov.command_name('Example') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'Example, Unit' do
6
6
 
7
- clazz = CukeModeler::Example
7
+ let(:clazz) { CukeModeler::Example }
8
8
 
9
- it_should_behave_like 'a feature element', clazz
10
- it_should_behave_like 'a nested element', clazz
11
- it_should_behave_like 'a tagged element', clazz
12
- it_should_behave_like 'a bare bones element', clazz
13
- it_should_behave_like 'a prepopulated element', clazz
14
- it_should_behave_like 'a sourced element', clazz
15
- it_should_behave_like 'a containing element', clazz
16
- it_should_behave_like 'a raw element', clazz
9
+ it_should_behave_like 'a feature element'
10
+ it_should_behave_like 'a nested element'
11
+ it_should_behave_like 'a tagged element'
12
+ it_should_behave_like 'a bare bones element'
13
+ it_should_behave_like 'a prepopulated element'
14
+ it_should_behave_like 'a sourced element'
15
+ it_should_behave_like 'a containing element'
16
+ it_should_behave_like 'a raw element'
17
17
 
18
18
 
19
19
  it 'can be parsed from stand alone text' do
@@ -29,12 +29,47 @@ describe 'Example, Unit' do
29
29
  @element.name.should == 'test example'
30
30
  end
31
31
 
32
+ # todo - add more tests like this to the 'barebones' test set
33
+ it 'can be instantiated with the minimum viable Gherkin', :gherkin4 => true do
34
+ source = ['Examples:']
35
+ source = source.join("\n")
36
+
37
+ expect { @element = clazz.new(source) }.to_not raise_error
38
+ end
39
+
40
+ # todo - add more tests like this to the 'barebones' test set
41
+ it 'can be instantiated with the minimum viable Gherkin', :gherkin3 => true do
42
+ source = ['Examples:',
43
+ '|param|',
44
+ '|value|']
45
+ source = source.join("\n")
46
+
47
+ expect { @element = clazz.new(source) }.to_not raise_error
48
+ end
49
+
50
+ # todo - add more tests like this to the 'barebones' test set
51
+ it 'can be instantiated with the minimum viable Gherkin', :gherkin2 => true do
52
+ source = ['Examples:',
53
+ '|param|']
54
+ source = source.join("\n")
55
+
56
+ expect { @element = clazz.new(source) }.to_not raise_error
57
+ end
58
+
32
59
  it 'provides a descriptive filename when being parsed from stand alone text' do
33
60
  source = 'bad example text'
34
61
 
35
62
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_example\.feature'/)
36
63
  end
37
64
 
65
+ it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
66
+ example = clazz.new("Examples: test example\n|param|\n|value|")
67
+ raw_data = example.raw_element
68
+
69
+ expect(raw_data.keys).to match_array([:type, :tags, :location, :keyword, :name, :tableHeader, :tableBody])
70
+ expect(raw_data[:type]).to eq(:Examples)
71
+ end
72
+
38
73
  it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
39
74
  example = clazz.new("Examples: test example\n|param|\n|value|")
40
75
  raw_data = example.raw_element
@@ -4,12 +4,12 @@ SimpleCov.command_name('FeatureElement') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'FeatureElement, Unit' do
6
6
 
7
- clazz = CukeModeler::FeatureElement
7
+ let(:clazz) { CukeModeler::FeatureElement }
8
8
 
9
- it_should_behave_like 'a feature element', clazz
10
- it_should_behave_like 'a nested element', clazz
11
- it_should_behave_like 'a prepopulated element', clazz
12
- it_should_behave_like 'a bare bones element', clazz
9
+ it_should_behave_like 'a feature element'
10
+ it_should_behave_like 'a nested element'
11
+ it_should_behave_like 'a prepopulated element'
12
+ it_should_behave_like 'a bare bones element'
13
13
 
14
14
 
15
15
  before(:each) do
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- shared_examples_for 'a feature element' do |clazz|
3
+ shared_examples_for 'a feature element' do
4
+
5
+ # clazz must be defined by the calling file
4
6
 
5
7
  before(:each) do
6
8
  @element = clazz.new
@@ -4,12 +4,12 @@ SimpleCov.command_name('FeatureFile') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'FeatureFile, Unit' do
6
6
 
7
- clazz = CukeModeler::FeatureFile
7
+ let(:clazz) { CukeModeler::FeatureFile }
8
8
 
9
- it_should_behave_like 'a nested element', clazz
10
- it_should_behave_like 'a containing element', clazz
11
- it_should_behave_like 'a bare bones element', clazz
12
- it_should_behave_like 'a prepopulated element', clazz
9
+ it_should_behave_like 'a nested element'
10
+ it_should_behave_like 'a containing element'
11
+ it_should_behave_like 'a bare bones element'
12
+ it_should_behave_like 'a prepopulated element'
13
13
 
14
14
 
15
15
  before(:each) do
@@ -4,16 +4,16 @@ SimpleCov.command_name('Feature') unless RUBY_VERSION.to_s < '1.9.0'
4
4
 
5
5
  describe 'Feature, Unit' do
6
6
 
7
- clazz = CukeModeler::Feature
7
+ let(:clazz) { CukeModeler::Feature }
8
8
 
9
- it_should_behave_like 'a feature element', clazz
10
- it_should_behave_like 'a nested element', clazz
11
- it_should_behave_like 'a containing element', clazz
12
- it_should_behave_like 'a tagged element', clazz
13
- it_should_behave_like 'a bare bones element', clazz
14
- it_should_behave_like 'a prepopulated element', clazz
15
- it_should_behave_like 'a sourced element', clazz
16
- it_should_behave_like 'a raw element', clazz
9
+ it_should_behave_like 'a feature element'
10
+ it_should_behave_like 'a nested element'
11
+ it_should_behave_like 'a containing element'
12
+ it_should_behave_like 'a tagged element'
13
+ it_should_behave_like 'a bare bones element'
14
+ it_should_behave_like 'a prepopulated element'
15
+ it_should_behave_like 'a sourced element'
16
+ it_should_behave_like 'a raw element'
17
17
 
18
18
  before(:each) do
19
19
  @feature = clazz.new
@@ -34,6 +34,14 @@ describe 'Feature, Unit' do
34
34
  expect { clazz.new(source) }.to raise_error(/'cuke_modeler_stand_alone_feature\.feature'/)
35
35
  end
36
36
 
37
+ it 'stores the original data generated by the parsing adapter', :gherkin4 => true do
38
+ feature = clazz.new('Feature: test feature')
39
+ raw_data = feature.raw_element
40
+
41
+ expect(raw_data.keys).to match_array([:type, :tags, :location, :language, :keyword, :name, :children])
42
+ expect(raw_data[:type]).to eq(:Feature)
43
+ end
44
+
37
45
  it 'stores the original data generated by the parsing adapter', :gherkin3 => true do
38
46
  feature = clazz.new('Feature: test feature')
39
47
  raw_data = feature.raw_element