gherkin 5.1.0 → 6.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -4
  3. data/bin/gherkin +43 -16
  4. data/gherkin-go/gherkin-go-darwin-386 +0 -0
  5. data/gherkin-go/gherkin-go-darwin-amd64 +0 -0
  6. data/gherkin-go/gherkin-go-freebsd-386 +0 -0
  7. data/gherkin-go/gherkin-go-freebsd-amd64 +0 -0
  8. data/gherkin-go/gherkin-go-freebsd-arm +0 -0
  9. data/gherkin-go/gherkin-go-linux-386 +0 -0
  10. data/gherkin-go/gherkin-go-linux-amd64 +0 -0
  11. data/gherkin-go/gherkin-go-linux-arm +0 -0
  12. data/gherkin-go/gherkin-go-linux-mips +2 -0
  13. data/gherkin-go/gherkin-go-linux-mips64 +2 -0
  14. data/gherkin-go/gherkin-go-linux-mips64le +2 -0
  15. data/gherkin-go/gherkin-go-linux-mipsle +2 -0
  16. data/gherkin-go/gherkin-go-linux-s390x +2 -0
  17. data/gherkin-go/gherkin-go-netbsd-386 +0 -0
  18. data/gherkin-go/gherkin-go-netbsd-amd64 +0 -0
  19. data/gherkin-go/gherkin-go-netbsd-arm +0 -0
  20. data/gherkin-go/gherkin-go-openbsd-386 +0 -0
  21. data/gherkin-go/gherkin-go-openbsd-amd64 +0 -0
  22. data/gherkin-go/gherkin-go-windows-386.exe +0 -0
  23. data/gherkin-go/gherkin-go-windows-amd64.exe +0 -0
  24. data/lib/gherkin/dialect.rb +16 -2
  25. data/lib/gherkin/exe_file_path.rb +3 -0
  26. data/lib/gherkin/gherkin.rb +75 -0
  27. data/lib/gherkin/protobuf_cucumber_messages.rb +30 -0
  28. data/spec/capture_warnings.rb +11 -5
  29. data/spec/coverage.rb +3 -6
  30. data/spec/gherkin/dialect_spec.rb +13 -0
  31. data/spec/gherkin/gherkin_spec.rb +354 -0
  32. metadata +49 -27
  33. data/lib/gherkin/ast_builder.rb +0 -257
  34. data/lib/gherkin/ast_node.rb +0 -30
  35. data/lib/gherkin/errors.rb +0 -45
  36. data/lib/gherkin/gherkin-languages.json +0 -3239
  37. data/lib/gherkin/gherkin_line.rb +0 -95
  38. data/lib/gherkin/parser.rb +0 -2310
  39. data/lib/gherkin/pickles/compiler.rb +0 -163
  40. data/lib/gherkin/stream/gherkin_events.rb +0 -71
  41. data/lib/gherkin/stream/source_events.rb +0 -26
  42. data/lib/gherkin/token.rb +0 -18
  43. data/lib/gherkin/token_formatter_builder.rb +0 -39
  44. data/lib/gherkin/token_matcher.rb +0 -169
  45. data/lib/gherkin/token_scanner.rb +0 -40
  46. data/spec/gherkin/parser_spec.rb +0 -280
  47. data/spec/gherkin/stream/gherkin_events_spec.rb +0 -27
  48. data/spec/gherkin/stream/test_fr.feature +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c66b95af339175dae07eee21dbfe46234e1a642f2c22ec2d9c6031503efc1974
4
- data.tar.gz: 546eb9edae7fedc96885b2672b6fed1bd0e8daf9b79aec2b2d19fc4a24bc81b3
3
+ metadata.gz: 1e7051086a62daf33ee23f42691d0a3649694ea80821974175f7f2fa5cdada23
4
+ data.tar.gz: 3a396634034f2d1c8370aeca2328595e4038b030a1d30755b9a1c0030158707c
5
5
  SHA512:
6
- metadata.gz: 19aafa00c304000ef00b29a08c9438bc5a95693427dfd1182c941061a49fb34736a1f63df08012a73e9de9ed8bd71b03faa429fb55e935ce07c80f1ceed51f05
7
- data.tar.gz: 25f3ba9e15dcd5802dafa84adfbbecc1c0ba0412e28957da408e256c5858bd8121f75f9be8b2a767cba0a22bd80e172044ac1b619c466828601ed97c5a48ec44
6
+ metadata.gz: 575a8827cff148a70711a8231d0d3f606e7ab104fb20a34420f3cb0e76fd4b7c9bfa94386dabb0d0823f2ff69be51b9e9c6424393f679c8661ed3e56203bb9fb
7
+ data.tar.gz: 48b083b51f3acb43eaf7d3568f0b2daba395888ccee90b5a34132974ad099a8461b2c8856fd7d9639a28b0ecf9adf0ba49d26b204f11e7bfde4d7a256c9980ef
data/README.md CHANGED
@@ -2,10 +2,7 @@
2
2
 
3
3
  Gherkin parser/compiler for Ruby. Please see [Gherkin](https://github.com/cucumber/gherkin) for details.
4
4
 
5
- ## Developers
6
-
7
- Some files are generated from the `gherkin-ruby.razor` file. Please run the
8
- following command to generate the ruby files.
5
+ ## To build
9
6
 
10
7
  ~~~bash
11
8
  cd <project_root>/ruby
@@ -1,34 +1,61 @@
1
1
  #!/usr/bin/env ruby
2
2
  $VERBOSE=nil # Shut up JRuby warnings on Travis
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib"))
4
+
4
5
  require 'optparse'
5
6
  require 'json'
6
- require 'gherkin/stream/source_events'
7
- require 'gherkin/stream/gherkin_events'
7
+ require 'gherkin/gherkin'
8
8
 
9
9
  options = {
10
- print_source: true,
11
- print_ast: true,
12
- print_pickles: true
10
+ include_source: true,
11
+ include_gherkin_document: true,
12
+ include_pickles: true,
13
+ protobuf: false
13
14
  }
14
15
 
15
16
  OptionParser.new do |opts|
16
- opts.on("--[no-]source", "Don't print source events") do |v|
17
- options[:print_source] = v
17
+ opts.on("--[no-]source", "Don't print source messages") do |v|
18
+ options[:include_source] = v
18
19
  end
19
- opts.on("--[no-]ast", "Don't print ast events") do |v|
20
- options[:print_ast] = v
20
+ opts.on("--[no-]ast", "Don't print ast messages") do |v|
21
+ options[:include_gherkin_document] = v
21
22
  end
22
- opts.on("--[no-]pickles", "Don't print pickle events") do |v|
23
- options[:print_pickles] = v
23
+ opts.on("--[no-]pickles", "Don't print pickle messages") do |v|
24
+ options[:include_pickles] = v
24
25
  end
25
26
  end.parse!
26
27
 
27
- source_events = Gherkin::Stream::SourceEvents.new(ARGV)
28
- gherkin_events = Gherkin::Stream::GherkinEvents.new(options)
28
+ def include_messages(messages)
29
+ messages.each do |message|
30
+ json = message.class.encode_json(message)
31
+ ob = JSON.parse(json)
32
+ remove_empties(ob)
33
+ puts JSON.generate(ob)
34
+ end
35
+ end
29
36
 
30
- source_events.enum.each do |source_event|
31
- gherkin_events.enum(source_event).each do |event|
32
- puts JSON.generate(event)
37
+ def remove_empties(ob)
38
+ if Hash === ob
39
+ ob.each do |key, value|
40
+ if value == []
41
+ ob.delete(key)
42
+ else
43
+ remove_empties(value)
44
+ end
45
+ end
46
+ elsif Array === ob
47
+ ob.each do |value|
48
+ remove_empties(value)
49
+ end
33
50
  end
34
51
  end
52
+
53
+ messages = ARGV.empty? ?
54
+ # Read protobuf from STDIN
55
+ Gherkin::ProtobufCucumberMessages.new(STDIN).messages
56
+ :
57
+ Gherkin::Gherkin.from_paths(
58
+ ARGV,
59
+ options
60
+ )
61
+ include_messages(messages)
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>gherkin-go/v6.0.10/gherkin-go-linux-mips</Key><RequestId>9BA4E98529360585</RequestId><HostId>LgE761MCAUDB2BXTUj5XTk8IKkQoCY19FBrvimajYJE+rd451soycWVWxsK8zE+yXl6b1lYH79g=</HostId></Error>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>gherkin-go/v6.0.10/gherkin-go-linux-mips64</Key><RequestId>34F63197D1A00BFF</RequestId><HostId>wIL30jU9d4iSAUtx/eFR3xqunYlEBaOtL2hQ77UZ8mEZmRJ5aVGFcQNCgY/Gp2KZj1pJv04JUtY=</HostId></Error>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>gherkin-go/v6.0.10/gherkin-go-linux-mips64le</Key><RequestId>79780A30A814B543</RequestId><HostId>DE0NzpSoLtmXmw5AUa0XSsfOfh89jhxoafVJTAXxY6LdbfVqcsneBkDvIxZthKjUfEn6q5t+jik=</HostId></Error>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>gherkin-go/v6.0.10/gherkin-go-linux-mipsle</Key><RequestId>CFC4710522D0D02B</RequestId><HostId>2vVq1SdPbDR6WOdUG734+vvWM8mcvax3t1ZzeMdFhDOgNOTxtkeIZW4zpfm4TKRQkbXZIJ0WcD4=</HostId></Error>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>gherkin-go/v6.0.10/gherkin-go-linux-s390x</Key><RequestId>C590F84DB9E09B43</RequestId><HostId>rcJIIedSh3pMck0vxGzVwWABy1bmEAyw16hXntKD5wEMDxg27Jigy28n5pXQ1ECXsexUj2x4qWU=</HostId></Error>
@@ -1,8 +1,18 @@
1
1
  require 'json'
2
+ require 'open3'
3
+ require 'c21e/exe_file'
4
+ require 'gherkin/exe_file_path'
2
5
 
3
6
  module Gherkin
4
- DIALECT_FILE_PATH = File.expand_path("gherkin-languages.json", File.dirname(__FILE__))
5
- DIALECTS = JSON.parse File.open(DIALECT_FILE_PATH, 'r:UTF-8').read
7
+ def self.dialects_json
8
+ gherkin_executable = C21e::ExeFile.new(EXE_FILE_PATH).target_file
9
+ data, = Open3.capture2e(gherkin_executable, '--dialects')
10
+ data
11
+ end
12
+
13
+ private_class_method :dialects_json
14
+
15
+ DIALECTS = JSON.parse(dialects_json)
6
16
 
7
17
  class Dialect
8
18
  def self.for(name)
@@ -19,6 +29,10 @@ module Gherkin
19
29
  @spec.fetch('feature')
20
30
  end
21
31
 
32
+ def rule_keywords
33
+ @spec.fetch('rule')
34
+ end
35
+
22
36
  def scenario_keywords
23
37
  @spec.fetch('scenario')
24
38
  end
@@ -0,0 +1,3 @@
1
+ module Gherkin
2
+ EXE_FILE_PATH = File.expand_path("#{File.dirname(__FILE__)}/../../gherkin-go/gherkin-go-{{.OS}}-{{.Arch}}{{.Ext}}")
3
+ end
@@ -0,0 +1,75 @@
1
+ require 'open3'
2
+ require 'c21e/exe_file'
3
+ require 'gherkin/protobuf_cucumber_messages'
4
+ require 'gherkin/exe_file_path'
5
+ require 'cucumber/messages'
6
+
7
+ module Gherkin
8
+ class Gherkin
9
+ include Cucumber::Messages::Varint
10
+
11
+ DEFAULT_OPTIONS = {
12
+ include_source: true,
13
+ include_gherkin_document: true,
14
+ include_pickles: true
15
+ }.freeze
16
+
17
+ def self.from_paths(paths, options={})
18
+ self.new(paths, [], options).messages
19
+ end
20
+
21
+ def self.from_sources(sources, options={})
22
+ self.new([], sources, options).messages
23
+ end
24
+
25
+ def self.from_source(uri, data, options={})
26
+ from_sources([encode_source_message(uri, data)], options)
27
+ end
28
+
29
+ def initialize(paths, sources, options)
30
+ @paths = paths
31
+ @sources = sources
32
+ @options = DEFAULT_OPTIONS.merge(options)
33
+ @gherkin_executable = C21e::ExeFile.new(EXE_FILE_PATH).target_file
34
+ end
35
+
36
+ def messages
37
+ args = base_args
38
+ args = args.concat(@paths)
39
+ stdin, stdout, stderr, wait_thr = Open3.popen3(*args)
40
+ stdin.binmode
41
+ @sources.each do |source|
42
+ wrapper = Cucumber::Messages::Wrapper.new(
43
+ source: source
44
+ )
45
+ proto = Cucumber::Messages::Wrapper.encode(wrapper)
46
+ encode_varint(stdin, proto.length)
47
+ stdin.write(proto)
48
+ end
49
+ stdin.close
50
+ ProtobufCucumberMessages.new(stdout, stderr).messages
51
+ end
52
+
53
+ private
54
+
55
+ def base_args
56
+ args = [@gherkin_executable]
57
+ args.push('--no-source') unless @options[:include_source]
58
+ args.push('--no-ast') unless @options[:include_gherkin_document]
59
+ args.push('--no-pickles') unless @options[:include_pickles]
60
+ args.push("--default-dialect=#{@options[:default_dialect]}") unless @options[:default_dialect].nil?
61
+ args
62
+ end
63
+
64
+ def self.encode_source_message(uri, data)
65
+ media_obj = Cucumber::Messages::Media.new
66
+ media_obj.encoding = 'UTF-8'
67
+ media_obj.content_type = 'text/x.cucumber.gherkin+plain'
68
+ source_obj = Cucumber::Messages::Source.new
69
+ source_obj.uri = uri
70
+ source_obj.data = data
71
+ source_obj.media = media_obj
72
+ source_obj
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,30 @@
1
+ require 'cucumber/messages'
2
+
3
+ module Gherkin
4
+ class ProtobufCucumberMessages
5
+ include Cucumber::Messages::Varint
6
+
7
+ def initialize(io, err = nil)
8
+ @io = io
9
+ @err = err
10
+ end
11
+
12
+ def messages
13
+ read_pipes = @err.nil? ? [@io] : [@io, @err]
14
+ Enumerator.new do |y|
15
+ while true
16
+ r, = IO.select(read_pipes)
17
+ if r.first == @err
18
+ raise @err.read unless @err.eof?
19
+ else
20
+ break if @io.eof?
21
+ len = decode_varint(@io)
22
+ buf = @io.read(len)
23
+ wrapper = Cucumber::Messages::Wrapper.decode(buf)
24
+ y.yield wrapper
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # With thanks to @myronmarston
2
3
  # https://github.com/vcr/vcr/blob/master/spec/capture_warnings.rb
3
4
 
@@ -12,14 +13,19 @@ module CaptureWarnings
12
13
  end
13
14
 
14
15
  if other_warnings.any?
15
- puts "#{ other_warnings.count } non-gherkin warnings detected, set VIEW_OTHER_WARNINGS=true to see them."
16
+ puts "#{ other_warnings.count } warnings detected, set VIEW_OTHER_WARNINGS=true to see them."
16
17
  print_warnings('other', other_warnings) if ENV['VIEW_OTHER_WARNINGS']
17
18
  end
18
19
 
20
+ # Until they fix https://bugs.ruby-lang.org/issues/10661
21
+ if RUBY_VERSION == "2.2.0"
22
+ project_warnings = project_warnings.reject { |w| w =~ /warning: possible reference to past scope/ }
23
+ end
24
+
19
25
  if project_warnings.any?
20
- puts "#{ project_warnings.count } gherkin warnings detected"
21
- print_warnings('gherkin', project_warnings)
22
- fail "Please remove all gherkin warnings."
26
+ puts "#{ project_warnings.count } warnings detected"
27
+ print_warnings('cucumber-expressions', project_warnings)
28
+ fail "Please remove all cucumber-expressions warnings."
23
29
  end
24
30
 
25
31
  ensure_system_exit_if_required
@@ -29,7 +35,7 @@ module CaptureWarnings
29
35
  old_stderr = STDERR.clone
30
36
  pipe_r, pipe_w = IO.pipe
31
37
  pipe_r.sync = true
32
- error = ""
38
+ error = String.new
33
39
  reader = Thread.new do
34
40
  begin
35
41
  loop do
@@ -1,10 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  require 'simplecov'
2
3
  formatters = [ SimpleCov::Formatter::HTMLFormatter ]
3
4
 
4
- if ENV['TRAVIS']
5
- require 'coveralls'
6
- formatters << Coveralls::SimpleCov::Formatter
7
- end
8
-
9
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(*formatters)
6
+ SimpleCov.add_filter 'spec/'
10
7
  SimpleCov.start
@@ -0,0 +1,13 @@
1
+ # coding: utf-8
2
+ require 'rspec'
3
+ require 'gherkin/dialect'
4
+
5
+ module Gherkin
6
+ describe Dialect do
7
+ it 'provides an interface to the keywords of a dialect' do
8
+ dialect_en = Dialect.for('en')
9
+
10
+ expect(dialect_en.feature_keywords).to eq(['Feature', 'Business Need', 'Ability'])
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,354 @@
1
+ # coding: utf-8
2
+ require 'rspec'
3
+ require 'gherkin/gherkin'
4
+
5
+ module Gherkin
6
+ describe Gherkin do
7
+ context 'using paths' do
8
+ it "works" do
9
+ messages = Gherkin.from_paths(
10
+ ["testdata/good/minimal.feature"]
11
+ )
12
+ expect(messages.to_a.length).to eq(3)
13
+ end
14
+ end
15
+
16
+ context 'using string content' do
17
+ it 'works' do
18
+ file = File.new('testdata/good/minimal.feature')
19
+ content = file.read.encode('UTF-8')
20
+ messages = Gherkin.from_source('testdata/good/minimal.feature', content).to_a
21
+ expect(messages.to_a.length).to eq(3)
22
+ end
23
+
24
+ it 'also works' do
25
+ content = """
26
+ Feature:
27
+
28
+ Scenario: scenario 1
29
+ Given text
30
+
31
+ Scenario: scenario 2
32
+ Given text
33
+
34
+ Scenario: scenario 3
35
+ Given text
36
+
37
+ Scenario: scenario 4
38
+ Given text
39
+
40
+ Scenario: scenario 5
41
+ Given text
42
+
43
+ Scenario: scenario 6
44
+ Given text
45
+
46
+ Scenario: scenario 7
47
+ Given text
48
+
49
+ Scenario: scenario 8
50
+ Given text
51
+
52
+ Scenario: scenario 9
53
+ Given text
54
+
55
+ Scenario: scenario 10
56
+ Given text
57
+
58
+ Scenario: scenario 11
59
+ Given text
60
+
61
+ Scenario: scenario 12
62
+ Given text
63
+
64
+ Scenario: scenario 13
65
+ Given text
66
+
67
+ Scenario: scenario 14
68
+ Given text
69
+
70
+ Scenario: scenario 15
71
+ Given text
72
+
73
+ Scenario: scenario 16
74
+ Given text
75
+
76
+ Scenario: scenario 17
77
+ Given text
78
+
79
+ Scenario: scenario 18
80
+ Given text
81
+
82
+ Scenario: scenario 19
83
+ Given text
84
+
85
+ Scenario: scenario 20
86
+ Given text
87
+
88
+ Scenario: scenario 21
89
+ Given text
90
+
91
+ Scenario: scenario 22
92
+ Given text
93
+
94
+ Scenario: scenario 23
95
+ Given text
96
+
97
+ Scenario: scenario 24
98
+ Given text
99
+
100
+ Scenario: scenario 25
101
+ Given text
102
+
103
+ Scenario: scenario 26
104
+ Given text
105
+
106
+ Scenario: scenario 27
107
+ Given text
108
+
109
+ Scenario: scenario 28
110
+ Given text
111
+
112
+ Scenario: scenario 29
113
+ Given text
114
+
115
+ Scenario: scenario 30
116
+ Given text
117
+
118
+ Scenario: scenario 31
119
+ Given text
120
+
121
+ Scenario: scenario 32
122
+ Given text
123
+
124
+ Scenario: scenario 33
125
+ Given text
126
+
127
+ Scenario: scenario 34
128
+ Given text
129
+
130
+ Scenario: scenario 35
131
+ Given text
132
+
133
+ Scenario: scenario 36
134
+ Given text
135
+
136
+ Scenario: scenario 37
137
+ Given text
138
+
139
+ Scenario: scenario 38
140
+ Given text
141
+
142
+ Scenario: scenario 39
143
+ Given text
144
+
145
+ Scenario: scenario 40
146
+ Given text
147
+
148
+ Scenario: scenario 41
149
+ Given text
150
+
151
+ Scenario: scenario 42
152
+ Given text
153
+
154
+ Scenario: scenario 43
155
+ Given text
156
+
157
+ Scenario: scenario 44
158
+ Given text
159
+
160
+ Scenario: scenario 45
161
+ Given text
162
+
163
+ Scenario: scenario 46
164
+ Given text
165
+
166
+ Scenario: scenario 47
167
+ Given text
168
+
169
+ Scenario: scenario 48
170
+ Given text
171
+
172
+ Scenario: scenario 49
173
+ Given text
174
+ """
175
+ messages = Gherkin.from_source('dummy', content).to_a
176
+ expect(messages.to_a.length).to eq(51)
177
+ end
178
+
179
+ it 'still works' do
180
+ content = """
181
+ Feature:
182
+
183
+ Scenario: scenario 1
184
+ Given text
185
+
186
+ Scenario: scenario 2
187
+ Given text
188
+
189
+ Scenario: scenario 3
190
+ Given text
191
+
192
+ Scenario: scenario 4
193
+ Given text
194
+
195
+ Scenario: scenario 5
196
+ Given text
197
+
198
+ Scenario: scenario 6
199
+ Given text
200
+
201
+ Scenario: scenario 7
202
+ Given text
203
+
204
+ Scenario: scenario 8
205
+ Given text
206
+
207
+ Scenario: scenario 9
208
+ Given text
209
+
210
+ Scenario: scenario 10
211
+ Given text
212
+
213
+ Scenario: scenario 11
214
+ Given text
215
+
216
+ Scenario: scenario 12
217
+ Given text
218
+
219
+ Scenario: scenario 13
220
+ Given text
221
+
222
+ Scenario: scenario 14
223
+ Given text
224
+
225
+ Scenario: scenario 15
226
+ Given text
227
+
228
+ Scenario: scenario 16
229
+ Given text
230
+
231
+ Scenario: scenario 17
232
+ Given text
233
+
234
+ Scenario: scenario 18
235
+ Given text
236
+
237
+ Scenario: scenario 19
238
+ Given text
239
+
240
+ Scenario: scenario 20
241
+ Given text
242
+
243
+ Scenario: scenario 21
244
+ Given text
245
+
246
+ Scenario: scenario 22
247
+ Given text
248
+
249
+ Scenario: scenario 23
250
+ Given text
251
+
252
+ Scenario: scenario 24
253
+ Given text
254
+
255
+ Scenario: scenario 25
256
+ Given text
257
+
258
+ Scenario: scenario 26
259
+ Given text
260
+
261
+ Scenario: scenario 27
262
+ Given text
263
+
264
+ Scenario: scenario 28
265
+ Given text
266
+
267
+ Scenario: scenario 29
268
+ Given text
269
+
270
+ Scenario: scenario 30
271
+ Given text
272
+
273
+ Scenario: scenario 31
274
+ Given text
275
+
276
+ Scenario: scenario 32
277
+ Given text
278
+
279
+ Scenario: scenario 33
280
+ Given text
281
+
282
+ Scenario: scenario 34
283
+ Given text
284
+
285
+ Scenario: scenario 35
286
+ Given text
287
+
288
+ Scenario: scenario 36
289
+ Given text
290
+
291
+ Scenario: scenario 37
292
+ Given text
293
+
294
+ Scenario: scenario 38
295
+ Given text
296
+
297
+ Scenario: scenario 39
298
+ Given text
299
+
300
+ Scenario: scenario 40
301
+ Given text
302
+
303
+ Scenario: scenario 41
304
+ Given text
305
+
306
+ Scenario: scenario 42
307
+ Given text
308
+
309
+ Scenario: scenario 43
310
+ Given text
311
+
312
+ Scenario: scenario 44
313
+ Given text
314
+
315
+ Scenario: scenario 45
316
+ Given text
317
+
318
+ Scenario: scenario 46
319
+ Given text
320
+
321
+ Scenario: scenario 47
322
+ Given text
323
+
324
+ Scenario: scenario 48
325
+ Given text
326
+
327
+ Scenario: scenario 49
328
+ Given text
329
+
330
+ Scenario: scenario 50
331
+ Given text
332
+ """
333
+ messages = Gherkin.from_source('dummy', content).to_a
334
+ expect(messages.to_a.length).to eq(52)
335
+ end
336
+
337
+ end
338
+
339
+ context 'setting the default dialect' do
340
+ it 'features will be parsed using the set default dialect' do
341
+ content = """
342
+ Egenskap: i18n support
343
+
344
+ Scenario: Parsing many languages
345
+ Gitt Gherkin supports many languages
346
+ Når Norwegian keywords are parsed
347
+ Så they should be recognized
348
+ """
349
+ messages = Gherkin.from_source('dummy', content, {default_dialect: 'no'})
350
+ expect(messages.to_a.length).to eq(3)
351
+ end
352
+ end
353
+ end
354
+ end