cucumber-cucumber-expressions 13.0.1 → 13.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +1 -1
  4. data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +2 -2
  5. data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +1 -1
  6. metadata +4 -112
  7. data/.github/ISSUE_TEMPLATE.md +0 -5
  8. data/.github/PULL_REQUEST_TEMPLATE.md +0 -5
  9. data/.rsync +0 -5
  10. data/.subrepo +0 -1
  11. data/examples.txt +0 -43
  12. data/spec/cucumber/cucumber_expressions/expression_examples_spec.rb +0 -30
  13. data/testdata/ast/alternation-followed-by-optional.yaml +0 -17
  14. data/testdata/ast/alternation-phrase.yaml +0 -16
  15. data/testdata/ast/alternation-with-parameter.yaml +0 -27
  16. data/testdata/ast/alternation-with-unused-end-optional.yaml +0 -15
  17. data/testdata/ast/alternation-with-unused-start-optional.yaml +0 -8
  18. data/testdata/ast/alternation-with-white-space.yaml +0 -12
  19. data/testdata/ast/alternation.yaml +0 -12
  20. data/testdata/ast/anonymous-parameter.yaml +0 -5
  21. data/testdata/ast/closing-brace.yaml +0 -5
  22. data/testdata/ast/closing-parenthesis.yaml +0 -5
  23. data/testdata/ast/empty-alternation.yaml +0 -8
  24. data/testdata/ast/empty-alternations.yaml +0 -9
  25. data/testdata/ast/empty-string.yaml +0 -3
  26. data/testdata/ast/escaped-alternation.yaml +0 -5
  27. data/testdata/ast/escaped-backslash.yaml +0 -5
  28. data/testdata/ast/escaped-opening-parenthesis.yaml +0 -5
  29. data/testdata/ast/escaped-optional-followed-by-optional.yaml +0 -15
  30. data/testdata/ast/escaped-optional-phrase.yaml +0 -10
  31. data/testdata/ast/escaped-optional.yaml +0 -7
  32. data/testdata/ast/opening-brace.yaml +0 -8
  33. data/testdata/ast/opening-parenthesis.yaml +0 -8
  34. data/testdata/ast/optional-containing-nested-optional.yaml +0 -15
  35. data/testdata/ast/optional-phrase.yaml +0 -12
  36. data/testdata/ast/optional.yaml +0 -7
  37. data/testdata/ast/parameter.yaml +0 -7
  38. data/testdata/ast/phrase.yaml +0 -9
  39. data/testdata/ast/unfinished-parameter.yaml +0 -8
  40. data/testdata/expression/allows-escaped-optional-parameter-types.yaml +0 -4
  41. data/testdata/expression/allows-parameter-type-in-alternation-1.yaml +0 -4
  42. data/testdata/expression/allows-parameter-type-in-alternation-2.yaml +0 -4
  43. data/testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml +0 -5
  44. data/testdata/expression/does-not-allow-alternation-in-optional.yaml +0 -9
  45. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml +0 -10
  46. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml +0 -9
  47. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml +0 -9
  48. data/testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml +0 -9
  49. data/testdata/expression/does-not-allow-empty-optional.yaml +0 -9
  50. data/testdata/expression/does-not-allow-nested-optional.yaml +0 -8
  51. data/testdata/expression/does-not-allow-optional-parameter-types.yaml +0 -9
  52. data/testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml +0 -10
  53. data/testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml +0 -8
  54. data/testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml +0 -8
  55. data/testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml +0 -8
  56. data/testdata/expression/does-not-match-misquoted-string.yaml +0 -4
  57. data/testdata/expression/doesnt-match-float-as-int.yaml +0 -5
  58. data/testdata/expression/matches-alternation.yaml +0 -4
  59. data/testdata/expression/matches-anonymous-parameter-type.yaml +0 -5
  60. data/testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
  61. data/testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml +0 -4
  62. data/testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml +0 -4
  63. data/testdata/expression/matches-double-quoted-string-with-single-quotes.yaml +0 -4
  64. data/testdata/expression/matches-double-quoted-string.yaml +0 -4
  65. data/testdata/expression/matches-doubly-escaped-parenthesis.yaml +0 -4
  66. data/testdata/expression/matches-doubly-escaped-slash-1.yaml +0 -4
  67. data/testdata/expression/matches-doubly-escaped-slash-2.yaml +0 -4
  68. data/testdata/expression/matches-escaped-parenthesis-1.yaml +0 -4
  69. data/testdata/expression/matches-escaped-parenthesis-2.yaml +0 -4
  70. data/testdata/expression/matches-escaped-parenthesis-3.yaml +0 -4
  71. data/testdata/expression/matches-escaped-slash.yaml +0 -4
  72. data/testdata/expression/matches-float-1.yaml +0 -5
  73. data/testdata/expression/matches-float-2.yaml +0 -5
  74. data/testdata/expression/matches-int.yaml +0 -5
  75. data/testdata/expression/matches-multiple-double-quoted-strings.yaml +0 -4
  76. data/testdata/expression/matches-multiple-single-quoted-strings.yaml +0 -4
  77. data/testdata/expression/matches-optional-before-alternation-1.yaml +0 -4
  78. data/testdata/expression/matches-optional-before-alternation-2.yaml +0 -4
  79. data/testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml +0 -4
  80. data/testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml +0 -4
  81. data/testdata/expression/matches-optional-in-alternation-1.yaml +0 -5
  82. data/testdata/expression/matches-optional-in-alternation-2.yaml +0 -5
  83. data/testdata/expression/matches-optional-in-alternation-3.yaml +0 -5
  84. data/testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
  85. data/testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml +0 -4
  86. data/testdata/expression/matches-single-quoted-string-with-double-quotes.yaml +0 -4
  87. data/testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml +0 -4
  88. data/testdata/expression/matches-single-quoted-string.yaml +0 -4
  89. data/testdata/expression/matches-word.yaml +0 -4
  90. data/testdata/expression/throws-unknown-parameter-type.yaml +0 -10
  91. data/testdata/regex/alternation-with-optional.yaml +0 -2
  92. data/testdata/regex/alternation.yaml +0 -2
  93. data/testdata/regex/empty.yaml +0 -2
  94. data/testdata/regex/escape-regex-characters.yaml +0 -2
  95. data/testdata/regex/optional.yaml +0 -2
  96. data/testdata/regex/parameter.yaml +0 -2
  97. data/testdata/regex/text.yaml +0 -2
  98. data/testdata/regex/unicode.yaml +0 -2
  99. data/testdata/tokens/alternation-phrase.yaml +0 -13
  100. data/testdata/tokens/alternation.yaml +0 -9
  101. data/testdata/tokens/empty-string.yaml +0 -6
  102. data/testdata/tokens/escape-non-reserved-character.yaml +0 -8
  103. data/testdata/tokens/escaped-alternation.yaml +0 -9
  104. data/testdata/tokens/escaped-char-has-start-index-of-text-token.yaml +0 -9
  105. data/testdata/tokens/escaped-end-of-line.yaml +0 -8
  106. data/testdata/tokens/escaped-optional.yaml +0 -7
  107. data/testdata/tokens/escaped-parameter.yaml +0 -7
  108. data/testdata/tokens/escaped-space.yaml +0 -7
  109. data/testdata/tokens/optional-phrase.yaml +0 -13
  110. data/testdata/tokens/optional.yaml +0 -9
  111. data/testdata/tokens/parameter-phrase.yaml +0 -13
  112. data/testdata/tokens/parameter.yaml +0 -9
  113. data/testdata/tokens/phrase.yaml +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abdf3cd3e3ef1625435edf7a0c7076c148deb20f311f3c1f25f02cd7b4f4085d
4
- data.tar.gz: 545703ed396856e7775307a49746dc2fdb4a2bba7aa732d9960b90d83976a155
3
+ metadata.gz: ce6fa2aa7210faa1a0d8ee59ae7dd869a304abfb531759a9b710fb177c6e805d
4
+ data.tar.gz: a29772d3f53f88833ed39757f1532f20955822466812d13144870c75bd6e3ec3
5
5
  SHA512:
6
- metadata.gz: 449a4b0ccc31d0398bea421da4cb5ff5f6be6daf437bd819a46e238c26c63989e18a32ed6e9e3fc71e099757e837bb04e9be1834b74852da39fc5b1b1581fe71
7
- data.tar.gz: 699da85cd5fdd9851b021b9505da384c80047cf6b12d2b3b9abebf189199f4952db2331328cbed1d9bab9d1c69478f34e8a46f463fa8f951eecb364bc2444857
6
+ metadata.gz: 6dc75e85a7af3603bc1a2bba4f92c7df13b59abde52a9bdcc78d4f30931cee9db0e7df0a00c8f03547943c3cdf6a125d1761716ce2abcb3effc6e43c302075a6
7
+ data.tar.gz: a23bc9cf22b04ddaddee267602e80f862508cd7127e93e9993af916fd1608745f1b60af848088b8eefebc7177c7777e04350940a4d3a9112ab7827cc80e62e29
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.0.1
1
+ 13.1.0
@@ -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.0.1
4
+ version: 13.1.0
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-15 00:00:00.000000000 Z
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.1.2
124
+ rubygems_version: 3.2.22
232
125
  signing_key:
233
126
  specification_version: 4
234
- summary: cucumber-expressions-13.0.1
127
+ summary: cucumber-expressions-13.1.0
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
@@ -1,5 +0,0 @@
1
- PLEASE DO NOT CREATE ISSUES IN THIS REPO.
2
- THIS REPO IS A READ-ONLY MIRROR.
3
-
4
- Create your issue in the Cucumber monorepo instead:
5
- https://github.com/cucumber/cucumber/issues
@@ -1,5 +0,0 @@
1
- PLEASE DO NOT CREATE PULL REAUESTS IN THIS REPO.
2
- THIS REPO IS A READ-ONLY MIRROR.
3
-
4
- Create your pull request in the Cucumber monorepo instead:
5
- https://github.com/cucumber/cucumber/pulls
data/.rsync DELETED
@@ -1,5 +0,0 @@
1
- ../../LICENSE LICENSE
2
- ../../.templates/github/ .github/
3
- ../../.templates/ruby/ .
4
- ../examples.txt examples.txt
5
- ../testdata .
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,5 +0,0 @@
1
- expression: "{}"
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 2, "nodes": [
4
- {"type": "PARAMETER_NODE", "start": 0, "end": 2, "nodes": []}
5
- ]}
@@ -1,5 +0,0 @@
1
- expression: "}"
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 1, "nodes": [
4
- {"type": "TEXT_NODE", "start": 0, "end": 1, "token": "}"}
5
- ]}
@@ -1,5 +0,0 @@
1
- expression: )
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 1, "nodes": [
4
- {"type": "TEXT_NODE", "start": 0, "end": 1, "token": ")"}
5
- ]}
@@ -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,3 +0,0 @@
1
- expression: ""
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 0, "nodes": []}
@@ -1,5 +0,0 @@
1
- expression: 'mice\/rats'
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 10, "nodes": [
4
- {"type": "TEXT_NODE", "start": 0, "end": 10, "token": "mice/rats"}
5
- ]}
@@ -1,5 +0,0 @@
1
- expression: '\\'
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 2, "nodes": [
4
- {"type": "TEXT_NODE", "start": 0, "end": 2, "token": "\\"}
5
- ]}
@@ -1,5 +0,0 @@
1
- expression: '\('
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 2, "nodes": [
4
- {"type": "TEXT_NODE", "start": 0, "end": 2, "token": "("}
5
- ]}
@@ -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,7 +0,0 @@
1
- expression: '\(blind)'
2
-
3
- expected: |-
4
- {"type": "EXPRESSION_NODE", "start": 0, "end": 8, "nodes": [
5
- {"type": "TEXT_NODE", "start": 0, "end": 7, "token": "(blind"},
6
- {"type": "TEXT_NODE", "start": 7, "end": 8, "token": ")"}
7
- ]}
@@ -1,8 +0,0 @@
1
- expression: '{'
2
- exception: |-
3
- This Cucumber Expression has a problem at column 1:
4
-
5
- {
6
- ^
7
- The '{' does not have a matching '}'.
8
- If you did not intend to use a parameter you can use '\{' to escape the a parameter
@@ -1,8 +0,0 @@
1
- expression: (
2
- exception: |-
3
- This Cucumber Expression has a problem at column 1:
4
-
5
- (
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,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
- ]}
@@ -1,7 +0,0 @@
1
- expression: (blind)
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 7, "nodes": [
4
- {"type": "OPTIONAL_NODE", "start": 0, "end": 7, "nodes": [
5
- {"type": "TEXT_NODE", "start": 1, "end": 6, "token": "blind"}
6
- ]}
7
- ]}
@@ -1,7 +0,0 @@
1
- expression: "{string}"
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 8, "nodes": [
4
- {"type": "PARAMETER_NODE", "start": 0, "end": 8, "nodes": [
5
- {"type": "TEXT_NODE", "start": 1, "end": 7, "token": "string"}
6
- ]}
7
- ]}
@@ -1,9 +0,0 @@
1
- expression: three blind mice
2
- expected: |-
3
- {"type": "EXPRESSION_NODE", "start": 0, "end": 16, "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": 11, "token": "blind"},
7
- {"type": "TEXT_NODE", "start": 11, "end": 12, "token": " "},
8
- {"type": "TEXT_NODE", "start": 12, "end": 16, "token": "mice"}
9
- ]}