cucumber-cucumber-expressions 13.0.1 → 13.1.3
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/VERSION +1 -1
- data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +1 -1
- data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +2 -2
- data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +1 -1
- metadata +4 -112
- data/.github/ISSUE_TEMPLATE.md +0 -5
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -5
- data/.rsync +0 -5
- data/.subrepo +0 -1
- data/examples.txt +0 -43
- data/spec/cucumber/cucumber_expressions/expression_examples_spec.rb +0 -30
- data/testdata/ast/alternation-followed-by-optional.yaml +0 -17
- data/testdata/ast/alternation-phrase.yaml +0 -16
- data/testdata/ast/alternation-with-parameter.yaml +0 -27
- data/testdata/ast/alternation-with-unused-end-optional.yaml +0 -15
- data/testdata/ast/alternation-with-unused-start-optional.yaml +0 -8
- data/testdata/ast/alternation-with-white-space.yaml +0 -12
- data/testdata/ast/alternation.yaml +0 -12
- data/testdata/ast/anonymous-parameter.yaml +0 -5
- data/testdata/ast/closing-brace.yaml +0 -5
- data/testdata/ast/closing-parenthesis.yaml +0 -5
- data/testdata/ast/empty-alternation.yaml +0 -8
- data/testdata/ast/empty-alternations.yaml +0 -9
- data/testdata/ast/empty-string.yaml +0 -3
- data/testdata/ast/escaped-alternation.yaml +0 -5
- data/testdata/ast/escaped-backslash.yaml +0 -5
- data/testdata/ast/escaped-opening-parenthesis.yaml +0 -5
- data/testdata/ast/escaped-optional-followed-by-optional.yaml +0 -15
- data/testdata/ast/escaped-optional-phrase.yaml +0 -10
- data/testdata/ast/escaped-optional.yaml +0 -7
- data/testdata/ast/opening-brace.yaml +0 -8
- data/testdata/ast/opening-parenthesis.yaml +0 -8
- data/testdata/ast/optional-containing-nested-optional.yaml +0 -15
- data/testdata/ast/optional-phrase.yaml +0 -12
- data/testdata/ast/optional.yaml +0 -7
- data/testdata/ast/parameter.yaml +0 -7
- data/testdata/ast/phrase.yaml +0 -9
- data/testdata/ast/unfinished-parameter.yaml +0 -8
- data/testdata/expression/allows-escaped-optional-parameter-types.yaml +0 -4
- data/testdata/expression/allows-parameter-type-in-alternation-1.yaml +0 -4
- data/testdata/expression/allows-parameter-type-in-alternation-2.yaml +0 -4
- data/testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml +0 -5
- data/testdata/expression/does-not-allow-alternation-in-optional.yaml +0 -9
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml +0 -10
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml +0 -9
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml +0 -9
- data/testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml +0 -9
- data/testdata/expression/does-not-allow-empty-optional.yaml +0 -9
- data/testdata/expression/does-not-allow-nested-optional.yaml +0 -8
- data/testdata/expression/does-not-allow-optional-parameter-types.yaml +0 -9
- data/testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml +0 -10
- data/testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml +0 -8
- data/testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml +0 -8
- data/testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml +0 -8
- data/testdata/expression/does-not-match-misquoted-string.yaml +0 -4
- data/testdata/expression/doesnt-match-float-as-int.yaml +0 -5
- data/testdata/expression/matches-alternation.yaml +0 -4
- data/testdata/expression/matches-anonymous-parameter-type.yaml +0 -5
- data/testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
- data/testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml +0 -4
- data/testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml +0 -4
- data/testdata/expression/matches-double-quoted-string-with-single-quotes.yaml +0 -4
- data/testdata/expression/matches-double-quoted-string.yaml +0 -4
- data/testdata/expression/matches-doubly-escaped-parenthesis.yaml +0 -4
- data/testdata/expression/matches-doubly-escaped-slash-1.yaml +0 -4
- data/testdata/expression/matches-doubly-escaped-slash-2.yaml +0 -4
- data/testdata/expression/matches-escaped-parenthesis-1.yaml +0 -4
- data/testdata/expression/matches-escaped-parenthesis-2.yaml +0 -4
- data/testdata/expression/matches-escaped-parenthesis-3.yaml +0 -4
- data/testdata/expression/matches-escaped-slash.yaml +0 -4
- data/testdata/expression/matches-float-1.yaml +0 -5
- data/testdata/expression/matches-float-2.yaml +0 -5
- data/testdata/expression/matches-int.yaml +0 -5
- data/testdata/expression/matches-multiple-double-quoted-strings.yaml +0 -4
- data/testdata/expression/matches-multiple-single-quoted-strings.yaml +0 -4
- data/testdata/expression/matches-optional-before-alternation-1.yaml +0 -4
- data/testdata/expression/matches-optional-before-alternation-2.yaml +0 -4
- data/testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml +0 -4
- data/testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml +0 -4
- data/testdata/expression/matches-optional-in-alternation-1.yaml +0 -5
- data/testdata/expression/matches-optional-in-alternation-2.yaml +0 -5
- data/testdata/expression/matches-optional-in-alternation-3.yaml +0 -5
- data/testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
- data/testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml +0 -4
- data/testdata/expression/matches-single-quoted-string-with-double-quotes.yaml +0 -4
- data/testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml +0 -4
- data/testdata/expression/matches-single-quoted-string.yaml +0 -4
- data/testdata/expression/matches-word.yaml +0 -4
- data/testdata/expression/throws-unknown-parameter-type.yaml +0 -10
- data/testdata/regex/alternation-with-optional.yaml +0 -2
- data/testdata/regex/alternation.yaml +0 -2
- data/testdata/regex/empty.yaml +0 -2
- data/testdata/regex/escape-regex-characters.yaml +0 -2
- data/testdata/regex/optional.yaml +0 -2
- data/testdata/regex/parameter.yaml +0 -2
- data/testdata/regex/text.yaml +0 -2
- data/testdata/regex/unicode.yaml +0 -2
- data/testdata/tokens/alternation-phrase.yaml +0 -13
- data/testdata/tokens/alternation.yaml +0 -9
- data/testdata/tokens/empty-string.yaml +0 -6
- data/testdata/tokens/escape-non-reserved-character.yaml +0 -8
- data/testdata/tokens/escaped-alternation.yaml +0 -9
- data/testdata/tokens/escaped-char-has-start-index-of-text-token.yaml +0 -9
- data/testdata/tokens/escaped-end-of-line.yaml +0 -8
- data/testdata/tokens/escaped-optional.yaml +0 -7
- data/testdata/tokens/escaped-parameter.yaml +0 -7
- data/testdata/tokens/escaped-space.yaml +0 -7
- data/testdata/tokens/optional-phrase.yaml +0 -13
- data/testdata/tokens/optional.yaml +0 -9
- data/testdata/tokens/parameter-phrase.yaml +0 -13
- data/testdata/tokens/parameter.yaml +0 -9
- data/testdata/tokens/phrase.yaml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b015bc63f3dc328fbeaaca9b20daf5e602f16f26cdfca8161ced76165397630f
|
4
|
+
data.tar.gz: 422f74a5f429d13f1f5895e2f2acbf2e81140b325e09abfec2ca47f61c014aa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795cd977c9827da57538d3bcd955cefdf81db77e475a6924c61f6917fff5c65082452457af4a2e7c560c47221f797af232785e9a01a62c79070232827726c896
|
7
|
+
data.tar.gz: bc55bfcaa4e6b190c53470c2ddaea86c78f1ccb82bdb343b519c5cd02ddd4b970065899ab4559f25aec9066c0c77901622560a520cea934d318feb5eb9a17858
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
13.
|
1
|
+
13.1.3
|
@@ -6,7 +6,7 @@ require 'cucumber/cucumber_expressions/errors'
|
|
6
6
|
module Cucumber
|
7
7
|
module CucumberExpressions
|
8
8
|
describe 'Cucumber expression parser' do
|
9
|
-
Dir['testdata/ast/*.yaml'].each do |testcase|
|
9
|
+
Dir['../testdata/ast/*.yaml'].each do |testcase|
|
10
10
|
expectation = YAML.load_file(testcase) # encoding?
|
11
11
|
it "#{testcase}" do
|
12
12
|
parser = CucumberExpressionParser.new
|
@@ -7,7 +7,7 @@ module Cucumber
|
|
7
7
|
module CucumberExpressions
|
8
8
|
describe CucumberExpression do
|
9
9
|
|
10
|
-
Dir['testdata/expression/*.yaml'].each do |testcase|
|
10
|
+
Dir['../testdata/expression/*.yaml'].each do |testcase|
|
11
11
|
expectation = YAML.load_file(testcase) # encoding?
|
12
12
|
it "#{testcase}" do
|
13
13
|
parameter_registry = ParameterTypeRegistry.new
|
@@ -25,7 +25,7 @@ module Cucumber
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
Dir['testdata/regex/*.yaml'].each do |testcase|
|
28
|
+
Dir['../testdata/regex/*.yaml'].each do |testcase|
|
29
29
|
expectation = YAML.load_file(testcase) # encoding?
|
30
30
|
it "#{testcase}" do
|
31
31
|
parameter_registry = ParameterTypeRegistry.new
|
@@ -6,7 +6,7 @@ require 'cucumber/cucumber_expressions/errors'
|
|
6
6
|
module Cucumber
|
7
7
|
module CucumberExpressions
|
8
8
|
describe 'Cucumber expression tokenizer' do
|
9
|
-
Dir['testdata/tokens/*.yaml'].each do |testcase|
|
9
|
+
Dir['../testdata/tokens/*.yaml'].each do |testcase|
|
10
10
|
expectation = YAML.load_file(testcase) # encoding?
|
11
11
|
it "#{testcase}" do
|
12
12
|
tokenizer = CucumberExpressionTokenizer.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-cucumber-expressions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.
|
4
|
+
version: 13.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -56,11 +56,7 @@ executables: []
|
|
56
56
|
extensions: []
|
57
57
|
extra_rdoc_files: []
|
58
58
|
files:
|
59
|
-
- ".github/ISSUE_TEMPLATE.md"
|
60
|
-
- ".github/PULL_REQUEST_TEMPLATE.md"
|
61
59
|
- ".rspec"
|
62
|
-
- ".rsync"
|
63
|
-
- ".subrepo"
|
64
60
|
- Gemfile
|
65
61
|
- LICENSE
|
66
62
|
- Makefile
|
@@ -69,7 +65,6 @@ files:
|
|
69
65
|
- VERSION
|
70
66
|
- cucumber-cucumber-expressions.gemspec
|
71
67
|
- default.mk
|
72
|
-
- examples.txt
|
73
68
|
- lib/cucumber/cucumber_expressions/argument.rb
|
74
69
|
- lib/cucumber/cucumber_expressions/ast.rb
|
75
70
|
- lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb
|
@@ -96,113 +91,11 @@ files:
|
|
96
91
|
- spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
|
97
92
|
- spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
|
98
93
|
- spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
|
99
|
-
- spec/cucumber/cucumber_expressions/expression_examples_spec.rb
|
100
94
|
- spec/cucumber/cucumber_expressions/expression_factory_spec.rb
|
101
95
|
- spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
|
102
96
|
- spec/cucumber/cucumber_expressions/parameter_type_spec.rb
|
103
97
|
- spec/cucumber/cucumber_expressions/regular_expression_spec.rb
|
104
98
|
- spec/cucumber/cucumber_expressions/tree_regexp_spec.rb
|
105
|
-
- testdata/ast/alternation-followed-by-optional.yaml
|
106
|
-
- testdata/ast/alternation-phrase.yaml
|
107
|
-
- testdata/ast/alternation-with-parameter.yaml
|
108
|
-
- testdata/ast/alternation-with-unused-end-optional.yaml
|
109
|
-
- testdata/ast/alternation-with-unused-start-optional.yaml
|
110
|
-
- testdata/ast/alternation-with-white-space.yaml
|
111
|
-
- testdata/ast/alternation.yaml
|
112
|
-
- testdata/ast/anonymous-parameter.yaml
|
113
|
-
- testdata/ast/closing-brace.yaml
|
114
|
-
- testdata/ast/closing-parenthesis.yaml
|
115
|
-
- testdata/ast/empty-alternation.yaml
|
116
|
-
- testdata/ast/empty-alternations.yaml
|
117
|
-
- testdata/ast/empty-string.yaml
|
118
|
-
- testdata/ast/escaped-alternation.yaml
|
119
|
-
- testdata/ast/escaped-backslash.yaml
|
120
|
-
- testdata/ast/escaped-opening-parenthesis.yaml
|
121
|
-
- testdata/ast/escaped-optional-followed-by-optional.yaml
|
122
|
-
- testdata/ast/escaped-optional-phrase.yaml
|
123
|
-
- testdata/ast/escaped-optional.yaml
|
124
|
-
- testdata/ast/opening-brace.yaml
|
125
|
-
- testdata/ast/opening-parenthesis.yaml
|
126
|
-
- testdata/ast/optional-containing-nested-optional.yaml
|
127
|
-
- testdata/ast/optional-phrase.yaml
|
128
|
-
- testdata/ast/optional.yaml
|
129
|
-
- testdata/ast/parameter.yaml
|
130
|
-
- testdata/ast/phrase.yaml
|
131
|
-
- testdata/ast/unfinished-parameter.yaml
|
132
|
-
- testdata/expression/allows-escaped-optional-parameter-types.yaml
|
133
|
-
- testdata/expression/allows-parameter-type-in-alternation-1.yaml
|
134
|
-
- testdata/expression/allows-parameter-type-in-alternation-2.yaml
|
135
|
-
- testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml
|
136
|
-
- testdata/expression/does-not-allow-alternation-in-optional.yaml
|
137
|
-
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml
|
138
|
-
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml
|
139
|
-
- testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml
|
140
|
-
- testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml
|
141
|
-
- testdata/expression/does-not-allow-empty-optional.yaml
|
142
|
-
- testdata/expression/does-not-allow-nested-optional.yaml
|
143
|
-
- testdata/expression/does-not-allow-optional-parameter-types.yaml
|
144
|
-
- testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml
|
145
|
-
- testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml
|
146
|
-
- testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml
|
147
|
-
- testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml
|
148
|
-
- testdata/expression/does-not-match-misquoted-string.yaml
|
149
|
-
- testdata/expression/doesnt-match-float-as-int.yaml
|
150
|
-
- testdata/expression/matches-alternation.yaml
|
151
|
-
- testdata/expression/matches-anonymous-parameter-type.yaml
|
152
|
-
- testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml
|
153
|
-
- testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml
|
154
|
-
- testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml
|
155
|
-
- testdata/expression/matches-double-quoted-string-with-single-quotes.yaml
|
156
|
-
- testdata/expression/matches-double-quoted-string.yaml
|
157
|
-
- testdata/expression/matches-doubly-escaped-parenthesis.yaml
|
158
|
-
- testdata/expression/matches-doubly-escaped-slash-1.yaml
|
159
|
-
- testdata/expression/matches-doubly-escaped-slash-2.yaml
|
160
|
-
- testdata/expression/matches-escaped-parenthesis-1.yaml
|
161
|
-
- testdata/expression/matches-escaped-parenthesis-2.yaml
|
162
|
-
- testdata/expression/matches-escaped-parenthesis-3.yaml
|
163
|
-
- testdata/expression/matches-escaped-slash.yaml
|
164
|
-
- testdata/expression/matches-float-1.yaml
|
165
|
-
- testdata/expression/matches-float-2.yaml
|
166
|
-
- testdata/expression/matches-int.yaml
|
167
|
-
- testdata/expression/matches-multiple-double-quoted-strings.yaml
|
168
|
-
- testdata/expression/matches-multiple-single-quoted-strings.yaml
|
169
|
-
- testdata/expression/matches-optional-before-alternation-1.yaml
|
170
|
-
- testdata/expression/matches-optional-before-alternation-2.yaml
|
171
|
-
- testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml
|
172
|
-
- testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml
|
173
|
-
- testdata/expression/matches-optional-in-alternation-1.yaml
|
174
|
-
- testdata/expression/matches-optional-in-alternation-2.yaml
|
175
|
-
- testdata/expression/matches-optional-in-alternation-3.yaml
|
176
|
-
- testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml
|
177
|
-
- testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml
|
178
|
-
- testdata/expression/matches-single-quoted-string-with-double-quotes.yaml
|
179
|
-
- testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml
|
180
|
-
- testdata/expression/matches-single-quoted-string.yaml
|
181
|
-
- testdata/expression/matches-word.yaml
|
182
|
-
- testdata/expression/throws-unknown-parameter-type.yaml
|
183
|
-
- testdata/regex/alternation-with-optional.yaml
|
184
|
-
- testdata/regex/alternation.yaml
|
185
|
-
- testdata/regex/empty.yaml
|
186
|
-
- testdata/regex/escape-regex-characters.yaml
|
187
|
-
- testdata/regex/optional.yaml
|
188
|
-
- testdata/regex/parameter.yaml
|
189
|
-
- testdata/regex/text.yaml
|
190
|
-
- testdata/regex/unicode.yaml
|
191
|
-
- testdata/tokens/alternation-phrase.yaml
|
192
|
-
- testdata/tokens/alternation.yaml
|
193
|
-
- testdata/tokens/empty-string.yaml
|
194
|
-
- testdata/tokens/escape-non-reserved-character.yaml
|
195
|
-
- testdata/tokens/escaped-alternation.yaml
|
196
|
-
- testdata/tokens/escaped-char-has-start-index-of-text-token.yaml
|
197
|
-
- testdata/tokens/escaped-end-of-line.yaml
|
198
|
-
- testdata/tokens/escaped-optional.yaml
|
199
|
-
- testdata/tokens/escaped-parameter.yaml
|
200
|
-
- testdata/tokens/escaped-space.yaml
|
201
|
-
- testdata/tokens/optional-phrase.yaml
|
202
|
-
- testdata/tokens/optional.yaml
|
203
|
-
- testdata/tokens/parameter-phrase.yaml
|
204
|
-
- testdata/tokens/parameter.yaml
|
205
|
-
- testdata/tokens/phrase.yaml
|
206
99
|
homepage: https://github.com/cucumber/cucumber-expressions-ruby#readme
|
207
100
|
licenses:
|
208
101
|
- MIT
|
@@ -228,10 +121,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
121
|
- !ruby/object:Gem::Version
|
229
122
|
version: '0'
|
230
123
|
requirements: []
|
231
|
-
rubygems_version: 3.
|
124
|
+
rubygems_version: 3.2.22
|
232
125
|
signing_key:
|
233
126
|
specification_version: 4
|
234
|
-
summary: cucumber-expressions-13.
|
127
|
+
summary: cucumber-expressions-13.1.3
|
235
128
|
test_files:
|
236
129
|
- spec/capture_warnings.rb
|
237
130
|
- spec/cucumber/cucumber_expressions/argument_spec.rb
|
@@ -241,7 +134,6 @@ test_files:
|
|
241
134
|
- spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
|
242
135
|
- spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
|
243
136
|
- spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
|
244
|
-
- spec/cucumber/cucumber_expressions/expression_examples_spec.rb
|
245
137
|
- spec/cucumber/cucumber_expressions/expression_factory_spec.rb
|
246
138
|
- spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
|
247
139
|
- spec/cucumber/cucumber_expressions/parameter_type_spec.rb
|
data/.github/ISSUE_TEMPLATE.md
DELETED
data/.rsync
DELETED
data/.subrepo
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
cucumber/cucumber-expressions-ruby
|
data/examples.txt
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
I have {int} cuke(s)
|
2
|
-
I have 22 cukes
|
3
|
-
[22]
|
4
|
-
---
|
5
|
-
I have {int} cuke(s) and some \\[]^$.|?*+
|
6
|
-
I have 1 cuke and some \[]^$.|?*+
|
7
|
-
[1]
|
8
|
-
---
|
9
|
-
/I have (\d+) cukes? in my (\w+) now/
|
10
|
-
I have 22 cukes in my belly now
|
11
|
-
[22,"belly"]
|
12
|
-
---
|
13
|
-
/I have (-?\d+) cukes? in my (.*) now/
|
14
|
-
I have 1 cuke in my belly now
|
15
|
-
[1,"belly"]
|
16
|
-
---
|
17
|
-
/^Something( with an optional argument)?$/
|
18
|
-
Something
|
19
|
-
[null]
|
20
|
-
---
|
21
|
-
Привет, {word}!
|
22
|
-
Привет, Мир!
|
23
|
-
["Мир"]
|
24
|
-
---
|
25
|
-
/I have (.*) cukes? in my (.*) now/
|
26
|
-
I have 22 cukes in my belly now
|
27
|
-
["22","belly"]
|
28
|
-
---
|
29
|
-
I have {} cuke(s) in my {} now
|
30
|
-
I have 22 cukes in my belly now
|
31
|
-
["22","belly"]
|
32
|
-
---
|
33
|
-
/^a (pre-commercial transaction |pre buyer fee model )?purchase(?: for \$(\d+))?$/
|
34
|
-
a purchase for $33
|
35
|
-
[null,33]
|
36
|
-
---
|
37
|
-
Some ${float} of cukes at {int}° Celsius
|
38
|
-
Some $3.50 of cukes at 42° Celsius
|
39
|
-
[3.5,42]
|
40
|
-
---
|
41
|
-
I select the {int}st/nd/rd/th Cucumber
|
42
|
-
I select the 3rd Cucumber
|
43
|
-
[3]
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'cucumber/cucumber_expressions/cucumber_expression'
|
2
|
-
require 'cucumber/cucumber_expressions/regular_expression'
|
3
|
-
require 'cucumber/cucumber_expressions/parameter_type_registry'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
module Cucumber
|
7
|
-
module CucumberExpressions
|
8
|
-
describe 'examples.txt' do
|
9
|
-
def match(expression_text, text)
|
10
|
-
expression = expression_text =~ /^\/(.*)\/$/ ?
|
11
|
-
RegularExpression.new(Regexp.new($1), ParameterTypeRegistry.new) :
|
12
|
-
CucumberExpression.new(expression_text, ParameterTypeRegistry.new)
|
13
|
-
|
14
|
-
arguments = expression.match(text)
|
15
|
-
return nil if arguments.nil?
|
16
|
-
arguments.map { |arg| arg.value(nil) }
|
17
|
-
end
|
18
|
-
|
19
|
-
File.open(File.expand_path("../../../../examples.txt", __FILE__), "r:utf-8") do |io|
|
20
|
-
chunks = io.read.split(/^---/m)
|
21
|
-
chunks.each do |chunk|
|
22
|
-
expression_text, text, expected_args = *chunk.strip.split(/\n/m)
|
23
|
-
it "Works with: #{expression_text}" do
|
24
|
-
expect( match(expression_text, text).to_json ).to eq(expected_args)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
expression: three blind\ rat/cat(s)
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 23, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "ALTERNATION_NODE", "start": 6, "end": 23, "nodes": [
|
7
|
-
{"type": "ALTERNATIVE_NODE", "start": 6, "end": 16, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 6, "end": 16, "token": "blind rat"}
|
9
|
-
]},
|
10
|
-
{"type": "ALTERNATIVE_NODE", "start": 17, "end": 23, "nodes": [
|
11
|
-
{"type": "TEXT_NODE", "start": 17, "end": 20, "token": "cat"},
|
12
|
-
{"type": "OPTIONAL_NODE", "start": 20, "end": 23, "nodes": [
|
13
|
-
{"type": "TEXT_NODE", "start": 21, "end": 22, "token": "s"}
|
14
|
-
]}
|
15
|
-
]}
|
16
|
-
]}
|
17
|
-
]}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
expression: three hungry/blind mice
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 23, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "ALTERNATION_NODE", "start": 6, "end": 18, "nodes": [
|
7
|
-
{"type": "ALTERNATIVE_NODE", "start": 6, "end": 12, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 6, "end": 12, "token": "hungry"}
|
9
|
-
]},
|
10
|
-
{"type": "ALTERNATIVE_NODE", "start": 13, "end": 18, "nodes": [
|
11
|
-
{"type": "TEXT_NODE", "start": 13, "end": 18, "token": "blind"}
|
12
|
-
]}
|
13
|
-
]},
|
14
|
-
{"type": "TEXT_NODE", "start": 18, "end": 19, "token": " "},
|
15
|
-
{"type": "TEXT_NODE", "start": 19, "end": 23, "token": "mice"}
|
16
|
-
]}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
expression: I select the {int}st/nd/rd/th
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 29, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 1, "token": "I"},
|
5
|
-
{"type": "TEXT_NODE", "start": 1, "end": 2, "token": " "},
|
6
|
-
{"type": "TEXT_NODE", "start": 2, "end": 8, "token": "select"},
|
7
|
-
{"type": "TEXT_NODE", "start": 8, "end": 9, "token": " "},
|
8
|
-
{"type": "TEXT_NODE", "start": 9, "end": 12, "token": "the"},
|
9
|
-
{"type": "TEXT_NODE", "start": 12, "end": 13, "token": " "},
|
10
|
-
{"type": "PARAMETER_NODE", "start": 13, "end": 18, "nodes": [
|
11
|
-
{"type": "TEXT_NODE", "start": 14, "end": 17, "token": "int"}
|
12
|
-
]},
|
13
|
-
{"type": "ALTERNATION_NODE", "start": 18, "end": 29, "nodes": [
|
14
|
-
{"type": "ALTERNATIVE_NODE", "start": 18, "end": 20, "nodes": [
|
15
|
-
{"type": "TEXT_NODE", "start": 18, "end": 20, "token": "st"}
|
16
|
-
]},
|
17
|
-
{"type": "ALTERNATIVE_NODE", "start": 21, "end": 23, "nodes": [
|
18
|
-
{"type": "TEXT_NODE", "start": 21, "end": 23, "token": "nd"}
|
19
|
-
]},
|
20
|
-
{"type": "ALTERNATIVE_NODE", "start": 24, "end": 26, "nodes": [
|
21
|
-
{"type": "TEXT_NODE", "start": 24, "end": 26, "token": "rd"}
|
22
|
-
]},
|
23
|
-
{"type": "ALTERNATIVE_NODE", "start": 27, "end": 29, "nodes": [
|
24
|
-
{"type": "TEXT_NODE", "start": 27, "end": 29, "token": "th"}
|
25
|
-
]}
|
26
|
-
]}
|
27
|
-
]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
expression: three )blind\ mice/rats
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 23, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "ALTERNATION_NODE", "start": 6, "end": 23, "nodes": [
|
7
|
-
{"type": "ALTERNATIVE_NODE", "start": 6, "end": 18, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 6, "end": 7, "token": ")"},
|
9
|
-
{"type": "TEXT_NODE", "start": 7, "end": 18, "token": "blind mice"}
|
10
|
-
]},
|
11
|
-
{"type": "ALTERNATIVE_NODE", "start": 19, "end": 23, "nodes": [
|
12
|
-
{"type": "TEXT_NODE", "start": 19, "end": 23, "token": "rats"}
|
13
|
-
]}
|
14
|
-
]}
|
15
|
-
]}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
expression: three blind\ mice/rats(
|
2
|
-
exception: |-
|
3
|
-
This Cucumber Expression has a problem at column 23:
|
4
|
-
|
5
|
-
three blind\ mice/rats(
|
6
|
-
^
|
7
|
-
The '(' does not have a matching ')'.
|
8
|
-
If you did not intend to use optional text you can use '\(' to escape the optional text
|
@@ -1,12 +0,0 @@
|
|
1
|
-
expression: '\ three\ hungry/blind\ mice\ '
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 29, "nodes": [
|
4
|
-
{"type": "ALTERNATION_NODE", "start": 0, "end": 29, "nodes": [
|
5
|
-
{"type": "ALTERNATIVE_NODE", "start": 0, "end": 15, "nodes": [
|
6
|
-
{"type": "TEXT_NODE", "start": 0, "end": 15, "token": " three hungry"}
|
7
|
-
]},
|
8
|
-
{"type": "ALTERNATIVE_NODE", "start": 16, "end": 29, "nodes": [
|
9
|
-
{"type": "TEXT_NODE", "start": 16, "end": 29, "token": "blind mice "}
|
10
|
-
]}
|
11
|
-
]}
|
12
|
-
]}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
expression: mice/rats
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 9, "nodes": [
|
4
|
-
{"type": "ALTERNATION_NODE", "start": 0, "end": 9, "nodes": [
|
5
|
-
{"type": "ALTERNATIVE_NODE", "start": 0, "end": 4, "nodes": [
|
6
|
-
{"type": "TEXT_NODE", "start": 0, "end": 4, "token": "mice"}
|
7
|
-
]},
|
8
|
-
{"type": "ALTERNATIVE_NODE", "start": 5, "end": 9, "nodes": [
|
9
|
-
{"type": "TEXT_NODE", "start": 5, "end": 9, "token": "rats"}
|
10
|
-
]}
|
11
|
-
]}
|
12
|
-
]}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
expression: /
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 1, "nodes": [
|
4
|
-
{"type": "ALTERNATION_NODE", "start": 0, "end": 1, "nodes": [
|
5
|
-
{"type": "ALTERNATIVE_NODE", "start": 0, "end": 0, "nodes": []},
|
6
|
-
{"type": "ALTERNATIVE_NODE", "start": 1, "end": 1, "nodes": []}
|
7
|
-
]}
|
8
|
-
]}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
expression: '//'
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 2, "nodes": [
|
4
|
-
{"type": "ALTERNATION_NODE", "start": 0, "end": 2, "nodes": [
|
5
|
-
{"type": "ALTERNATIVE_NODE", "start": 0, "end": 0, "nodes": []},
|
6
|
-
{"type": "ALTERNATIVE_NODE", "start": 1, "end": 1, "nodes": []},
|
7
|
-
{"type": "ALTERNATIVE_NODE", "start": 2, "end": 2, "nodes": []}
|
8
|
-
]}
|
9
|
-
]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
expression: three \((very) blind) mice
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 26, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "TEXT_NODE", "start": 6, "end": 8, "token": "("},
|
7
|
-
{"type": "OPTIONAL_NODE", "start": 8, "end": 14, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 9, "end": 13, "token": "very"}
|
9
|
-
]},
|
10
|
-
{"type": "TEXT_NODE", "start": 14, "end": 15, "token": " "},
|
11
|
-
{"type": "TEXT_NODE", "start": 15, "end": 20, "token": "blind"},
|
12
|
-
{"type": "TEXT_NODE", "start": 20, "end": 21, "token": ")"},
|
13
|
-
{"type": "TEXT_NODE", "start": 21, "end": 22, "token": " "},
|
14
|
-
{"type": "TEXT_NODE", "start": 22, "end": 26, "token": "mice"}
|
15
|
-
]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
expression: three \(blind) mice
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 19, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "TEXT_NODE", "start": 6, "end": 13, "token": "(blind"},
|
7
|
-
{"type": "TEXT_NODE", "start": 13, "end": 14, "token": ")"},
|
8
|
-
{"type": "TEXT_NODE", "start": 14, "end": 15, "token": " "},
|
9
|
-
{"type": "TEXT_NODE", "start": 15, "end": 19, "token": "mice"}
|
10
|
-
]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
expression: three ((very) blind) mice
|
2
|
-
expected: |-
|
3
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 25, "nodes": [
|
4
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
5
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
6
|
-
{"type": "OPTIONAL_NODE", "start": 6, "end": 20, "nodes": [
|
7
|
-
{"type": "OPTIONAL_NODE", "start": 7, "end": 13, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 8, "end": 12, "token": "very"}
|
9
|
-
]},
|
10
|
-
{"type": "TEXT_NODE", "start": 13, "end": 14, "token": " "},
|
11
|
-
{"type": "TEXT_NODE", "start": 14, "end": 19, "token": "blind"}
|
12
|
-
]},
|
13
|
-
{"type": "TEXT_NODE", "start": 20, "end": 21, "token": " "},
|
14
|
-
{"type": "TEXT_NODE", "start": 21, "end": 25, "token": "mice"}
|
15
|
-
]}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
expression: three (blind) mice
|
2
|
-
|
3
|
-
expected: |-
|
4
|
-
{"type": "EXPRESSION_NODE", "start": 0, "end": 18, "nodes": [
|
5
|
-
{"type": "TEXT_NODE", "start": 0, "end": 5, "token": "three"},
|
6
|
-
{"type": "TEXT_NODE", "start": 5, "end": 6, "token": " "},
|
7
|
-
{"type": "OPTIONAL_NODE", "start": 6, "end": 13, "nodes": [
|
8
|
-
{"type": "TEXT_NODE", "start": 7, "end": 12, "token": "blind"}
|
9
|
-
]},
|
10
|
-
{"type": "TEXT_NODE", "start": 13, "end": 14, "token": " "},
|
11
|
-
{"type": "TEXT_NODE", "start": 14, "end": 18, "token": "mice"}
|
12
|
-
]}
|
data/testdata/ast/optional.yaml
DELETED
data/testdata/ast/parameter.yaml
DELETED