cucumber-gherkin 11.0.0 → 14.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gherkin.rb +1 -1
- data/lib/gherkin/ast_builder.rb +4 -1
- data/lib/gherkin/gherkin-languages.json +5 -5
- data/lib/gherkin/parser.rb +5 -5
- data/lib/gherkin/query.rb +1 -0
- data/lib/gherkin/stream/parser_message_stream.rb +9 -9
- data/lib/gherkin/token_matcher.rb +2 -2
- data/lib/gherkin/token_scanner.rb +2 -2
- data/spec/gherkin/gherkin_line_spec.rb +26 -0
- data/spec/gherkin/parser_spec.rb +10 -0
- data/spec/gherkin/query_spec.rb +18 -4
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d52d0c5ccf99360cc6620cc0d81fa7bfaf74d058d7922c7dcd3bb5a5ac4bd52
|
4
|
+
data.tar.gz: de54e5009f7001b4e3c9c838fab6cffd5ee4d86f52e63ade6894d451e29e471c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49148577aa1f5221bd837ebf0d4e93699f112a04edd54f4bcfee4cf2b7aab8287a39625f555e029334a27e6da754e39a659a4c91212ba92eb84e0c6d1b0437cf
|
7
|
+
data.tar.gz: 929be4669eab80e0a307465c1192258d1f0a7469a21ebc665027389312084a2ff77b0494abeb2304ff5a05df35cdda657be408c746c1f9fc95ecfc3d68795cca
|
data/README.md
CHANGED
data/lib/gherkin.rb
CHANGED
data/lib/gherkin/ast_builder.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'cucumber/messages'
|
2
|
-
|
2
|
+
require_relative 'ast_node'
|
3
3
|
|
4
4
|
module Gherkin
|
5
5
|
class AstBuilder
|
@@ -146,6 +146,7 @@ module Gherkin
|
|
146
146
|
steps = get_steps(node)
|
147
147
|
|
148
148
|
Cucumber::Messages::GherkinDocument::Feature::Background.new(
|
149
|
+
id: @id_generator.new_id,
|
149
150
|
location: get_location(background_line, 0),
|
150
151
|
keyword: background_line.matched_keyword,
|
151
152
|
name: background_line.matched_text,
|
@@ -180,6 +181,7 @@ module Gherkin
|
|
180
181
|
table_body = rows.nil? ? nil : rows[1..-1]
|
181
182
|
|
182
183
|
Cucumber::Messages::GherkinDocument::Feature::Scenario::Examples.new(
|
184
|
+
id: @id_generator.new_id,
|
183
185
|
tags: tags,
|
184
186
|
location: get_location(examples_line, 0),
|
185
187
|
keyword: examples_line.matched_keyword,
|
@@ -237,6 +239,7 @@ module Gherkin
|
|
237
239
|
description = get_description(header)
|
238
240
|
|
239
241
|
Cucumber::Messages::GherkinDocument::Feature::FeatureChild::Rule.new(
|
242
|
+
id: @id_generator.new_id,
|
240
243
|
location: get_location(rule_line, 0),
|
241
244
|
keyword: rule_line.matched_keyword,
|
242
245
|
name: rule_line.matched_text,
|
@@ -1133,14 +1133,14 @@
|
|
1133
1133
|
"name": "Estonian",
|
1134
1134
|
"native": "eesti keel",
|
1135
1135
|
"rule": [
|
1136
|
-
"
|
1136
|
+
"Reegel"
|
1137
1137
|
],
|
1138
1138
|
"scenario": [
|
1139
1139
|
"Juhtum",
|
1140
1140
|
"Stsenaarium"
|
1141
1141
|
],
|
1142
1142
|
"scenarioOutline": [
|
1143
|
-
"
|
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
|
-
"
|
1474
|
+
"כלל"
|
1475
1475
|
],
|
1476
1476
|
"scenario": [
|
1477
1477
|
"דוגמא",
|
@@ -2729,7 +2729,7 @@
|
|
2729
2729
|
"name": "Russian",
|
2730
2730
|
"native": "русский",
|
2731
2731
|
"rule": [
|
2732
|
-
"
|
2732
|
+
"Правило"
|
2733
2733
|
],
|
2734
2734
|
"scenario": [
|
2735
2735
|
"Пример",
|
@@ -3622,4 +3622,4 @@
|
|
3622
3622
|
"जेव्हा "
|
3623
3623
|
]
|
3624
3624
|
}
|
3625
|
-
}
|
3625
|
+
}
|
data/lib/gherkin/parser.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# This file is generated. Do not edit! Edit gherkin-ruby.razor instead.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
|
data/lib/gherkin/query.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'cucumber/messages'
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
require_relative '../parser'
|
3
|
+
require_relative '../token_matcher'
|
4
|
+
require_relative '../pickles/compiler'
|
5
5
|
|
6
6
|
module Gherkin
|
7
7
|
module Stream
|
@@ -39,9 +39,9 @@ module Gherkin
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
rescue CompositeParserException => err
|
42
|
-
|
42
|
+
yield_parse_errors(y, err.errors, source.uri)
|
43
43
|
rescue ParserException => err
|
44
|
-
|
44
|
+
yield_parse_errors(y, [err], source.uri)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -49,9 +49,9 @@ module Gherkin
|
|
49
49
|
|
50
50
|
private
|
51
51
|
|
52
|
-
def
|
52
|
+
def yield_parse_errors(y, errors, uri)
|
53
53
|
errors.each do |err|
|
54
|
-
|
54
|
+
parse_error = Cucumber::Messages::ParseError.new(
|
55
55
|
source: Cucumber::Messages::SourceReference.new(
|
56
56
|
uri: uri,
|
57
57
|
location: Cucumber::Messages::Location.new(
|
@@ -59,9 +59,9 @@ module Gherkin
|
|
59
59
|
column: err.location[:column]
|
60
60
|
)
|
61
61
|
),
|
62
|
-
|
62
|
+
message: err.message
|
63
63
|
)
|
64
|
-
y.yield(Cucumber::Messages::Envelope.new(
|
64
|
+
y.yield(Cucumber::Messages::Envelope.new(parse_error: parse_error))
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -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
|
data/spec/gherkin/query_spec.rb
CHANGED
@@ -59,13 +59,27 @@ describe Gherkin::Query do
|
|
59
59
|
"""
|
60
60
|
}
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
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:
|
4
|
+
version: 14.1.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-
|
13
|
+
date: 2020-07-29 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: '
|
21
|
+
version: '12.3'
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
24
|
+
version: 12.3.2
|
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: '
|
31
|
+
version: '12.3'
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 12.3.2
|
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
|
-
|
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-
|
139
|
+
summary: cucumber-gherkin-14.1.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
|