cucumber-gherkin 13.0.0 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 790df8f2756156e70bbdcfd83400e84e130d2b888813d11961653ea35c82bc10
4
- data.tar.gz: e1f88bcd257573102c2ea47aac13ea91b9a4127424a6295b3bd9e385b8d3f8ff
3
+ metadata.gz: ccf27e037bbb0b5b0769a91c64b90b5bf25baf369739ca518a487e0d9a6ce0c4
4
+ data.tar.gz: 41f7ac52307d9f0c28734dc01c2cd7240d669ad8cdce8e4d3eaf329dec1cf2c5
5
5
  SHA512:
6
- metadata.gz: 491ef64c415875f35a2c5749a13c051dfcc16dffe480b53368c77d15a6d1d4036d1f73e5feadf67506090da43a61e683b177c840e40b283f9f6f25e3a4be18ed
7
- data.tar.gz: d0047ab40023484d8530fe77d7273331972248fcd3fad9819ca93f1ed64d32e0e119d692e2febee9fa7751e13f88dafe942f788a51098e9c5f0b83956431935a
6
+ metadata.gz: f3d2b6abb06cbcf4d75092827a8c7ec2e07f2ecf707f4c6efb0775d1d6cdd3d1ba626e2e622d011b125a73df27b58e3a5a786a8ce7bb27d00c4afa21fb092517
7
+ data.tar.gz: 52cc53bfc74b788bae1028d011eac61034c37e16eac8137815361449d6817aad2be0a2465b3e2431798673ec5f7e38a04bd37474e802cdfd884c5091261d48b3
@@ -1,4 +1,4 @@
1
- require 'gherkin/stream/parser_message_stream'
1
+ require_relative 'gherkin/stream/parser_message_stream'
2
2
 
3
3
  module Gherkin
4
4
  DEFAULT_OPTIONS = {
@@ -1,5 +1,5 @@
1
1
  require 'cucumber/messages'
2
- require 'gherkin/ast_node'
2
+ require_relative 'ast_node'
3
3
 
4
4
  module Gherkin
5
5
  class AstBuilder
@@ -1133,14 +1133,14 @@
1133
1133
  "name": "Estonian",
1134
1134
  "native": "eesti keel",
1135
1135
  "rule": [
1136
- "Rule"
1136
+ "Reegel"
1137
1137
  ],
1138
1138
  "scenario": [
1139
1139
  "Juhtum",
1140
1140
  "Stsenaarium"
1141
1141
  ],
1142
1142
  "scenarioOutline": [
1143
- "Raamstjuhtum",
1143
+ "Raamjuhtum",
1144
1144
  "Raamstsenaarium"
1145
1145
  ],
1146
1146
  "then": [
@@ -1471,7 +1471,7 @@
1471
1471
  "name": "Hebrew",
1472
1472
  "native": "עברית",
1473
1473
  "rule": [
1474
- "Rule"
1474
+ "כלל"
1475
1475
  ],
1476
1476
  "scenario": [
1477
1477
  "דוגמא",
@@ -2729,7 +2729,7 @@
2729
2729
  "name": "Russian",
2730
2730
  "native": "русский",
2731
2731
  "rule": [
2732
- "Rule"
2732
+ "Правило"
2733
2733
  ],
2734
2734
  "scenario": [
2735
2735
  "Пример",
@@ -3622,4 +3622,4 @@
3622
3622
  "जेव्हा "
3623
3623
  ]
3624
3624
  }
3625
- }
3625
+ }
@@ -1,8 +1,8 @@
1
1
  # This file is generated. Do not edit! Edit gherkin-ruby.razor instead.
2
- require 'gherkin/ast_builder'
3
- require 'gherkin/token_matcher'
4
- require 'gherkin/token_scanner'
5
- require 'gherkin/errors'
2
+ require_relative 'ast_builder'
3
+ require_relative 'token_matcher'
4
+ require_relative 'token_scanner'
5
+ require_relative 'errors'
6
6
 
7
7
  module Gherkin
8
8
 
@@ -56,7 +56,7 @@ module Gherkin
56
56
  class Parser
57
57
  attr_accessor :stop_at_first_error
58
58
 
59
- def initialize(ast_builder = AstBuilder.new)
59
+ def initialize(ast_builder = AstBuilder.new(Cucumber::Messages::IdGenerator::UUID.new))
60
60
  @ast_builder = ast_builder
61
61
  end
62
62
 
@@ -16,6 +16,7 @@ module Gherkin
16
16
  private
17
17
 
18
18
  def update_feature(feature)
19
+ return if feature.nil?
19
20
  store_nodes_location(feature.tags)
20
21
 
21
22
  feature.children.each do |child|
@@ -1,7 +1,7 @@
1
1
  require 'cucumber/messages'
2
- require 'gherkin/parser'
3
- require 'gherkin/token_matcher'
4
- require 'gherkin/pickles/compiler'
2
+ require_relative '../parser'
3
+ require_relative '../token_matcher'
4
+ require_relative '../pickles/compiler'
5
5
 
6
6
  module Gherkin
7
7
  module Stream
@@ -1,5 +1,5 @@
1
- require 'gherkin/dialect'
2
- require 'gherkin/errors'
1
+ require_relative 'dialect'
2
+ require_relative 'errors'
3
3
 
4
4
  module Gherkin
5
5
  class TokenMatcher
@@ -1,6 +1,6 @@
1
1
  require 'stringio'
2
- require 'gherkin/token'
3
- require 'gherkin/gherkin_line'
2
+ require_relative 'token'
3
+ require_relative 'gherkin_line'
4
4
 
5
5
  module Gherkin
6
6
  # The scanner reads a gherkin doc (typically read from a .feature file) and
@@ -0,0 +1,26 @@
1
+ require 'rspec'
2
+ require 'gherkin/gherkin_line'
3
+
4
+ describe Gherkin::GherkinLine do
5
+ context '#table_cell' do
6
+ def cells_text(line)
7
+ Gherkin::GherkinLine.new(line, 12).table_cells.map(&:text)
8
+ end
9
+
10
+ it 'trims white spaces before cell content' do
11
+ expect(cells_text("| \t spaces before|")).to eq(['spaces before'])
12
+ end
13
+
14
+ it 'trims white spaces after cell content' do
15
+ expect(cells_text("|spaces after |")).to eq(['spaces after'])
16
+ end
17
+
18
+ it 'trims white spaces around cell content' do
19
+ expect(cells_text("| \t spaces everywhere \t|")).to eq(['spaces everywhere'])
20
+ end
21
+
22
+ it 'does not drop white spaces inside a cell' do
23
+ expect(cells_text("| foo()\n bar\nbaz |")).to eq(["foo()\n bar\nbaz"])
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,10 @@
1
+ require 'rspec'
2
+ require 'gherkin'
3
+
4
+ describe Gherkin::Parser do
5
+ context '.new' do
6
+ it 'can be invoked with no args' do
7
+ Gherkin::Parser.new
8
+ end
9
+ end
10
+ end
@@ -59,13 +59,27 @@ describe Gherkin::Query do
59
59
  """
60
60
  }
61
61
 
62
- before do
63
- messages.each { |message|
64
- subject.update(message)
65
- }
62
+ context '#update' do
63
+ context 'when the feature file is empty' do
64
+ let(:feature_content) { '' }
65
+
66
+ it 'does not fail' do
67
+ expect {
68
+ messages.each { |message|
69
+ subject.update(message)
70
+ }
71
+ }.not_to raise_exception
72
+ end
73
+ end
66
74
  end
67
75
 
68
76
  context '#location' do
77
+ before do
78
+ messages.each { |message|
79
+ subject.update(message)
80
+ }
81
+ end
82
+
69
83
  let(:background) { find_message_by_attribute(gherkin_document.feature.children, :background) }
70
84
  let(:scenarios) { filter_messages_by_attribute(gherkin_document.feature.children, :scenario) }
71
85
  let(:scenario) { scenarios.first }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-gherkin
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.0
4
+ version: 14.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gáspár Nagy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-14 00:00:00.000000000 Z
13
+ date: 2020-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber-messages
@@ -18,20 +18,20 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '12.0'
21
+ version: '12.2'
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: 12.0.0
24
+ version: 12.2.0
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - "~>"
30
30
  - !ruby/object:Gem::Version
31
- version: '12.0'
31
+ version: '12.2'
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 12.0.0
34
+ version: 12.2.0
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rake
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -102,7 +102,9 @@ files:
102
102
  - lib/gherkin/token_scanner.rb
103
103
  - spec/capture_warnings.rb
104
104
  - spec/gherkin/dialect_spec.rb
105
+ - spec/gherkin/gherkin_line_spec.rb
105
106
  - spec/gherkin/gherkin_spec.rb
107
+ - spec/gherkin/parser_spec.rb
106
108
  - spec/gherkin/query_spec.rb
107
109
  - spec/gherkin/stream/parser_message_stream_spec.rb
108
110
  - spec/gherkin/stream/subprocess_message_stream_spec.rb
@@ -131,15 +133,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  - !ruby/object:Gem::Version
132
134
  version: '0'
133
135
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.7.6.2
136
+ rubygems_version: 3.1.2
136
137
  signing_key:
137
138
  specification_version: 4
138
- summary: cucumber-gherkin-13.0.0
139
+ summary: cucumber-gherkin-14.0.0
139
140
  test_files:
140
141
  - spec/gherkin/dialect_spec.rb
142
+ - spec/gherkin/gherkin_line_spec.rb
141
143
  - spec/gherkin/stream/parser_message_stream_spec.rb
142
144
  - spec/gherkin/stream/subprocess_message_stream_spec.rb
145
+ - spec/gherkin/parser_spec.rb
143
146
  - spec/gherkin/gherkin_spec.rb
144
147
  - spec/gherkin/query_spec.rb
145
148
  - spec/capture_warnings.rb