cucumber-cucumber-expressions 12.1.3 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb +0 -4
  5. data/spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb +14 -14
  6. data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +1 -1
  7. data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +2 -2
  8. data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +1 -1
  9. data/spec/cucumber/cucumber_expressions/regular_expression_spec.rb +4 -0
  10. metadata +4 -114
  11. data/.github/ISSUE_TEMPLATE.md +0 -5
  12. data/.github/PULL_REQUEST_TEMPLATE.md +0 -5
  13. data/.rsync +0 -5
  14. data/.subrepo +0 -1
  15. data/Makefile +0 -1
  16. data/default.mk +0 -93
  17. data/examples.txt +0 -43
  18. data/spec/cucumber/cucumber_expressions/expression_examples_spec.rb +0 -30
  19. data/testdata/ast/alternation-followed-by-optional.yaml +0 -17
  20. data/testdata/ast/alternation-phrase.yaml +0 -16
  21. data/testdata/ast/alternation-with-parameter.yaml +0 -27
  22. data/testdata/ast/alternation-with-unused-end-optional.yaml +0 -15
  23. data/testdata/ast/alternation-with-unused-start-optional.yaml +0 -8
  24. data/testdata/ast/alternation-with-white-space.yaml +0 -12
  25. data/testdata/ast/alternation.yaml +0 -12
  26. data/testdata/ast/anonymous-parameter.yaml +0 -5
  27. data/testdata/ast/closing-brace.yaml +0 -5
  28. data/testdata/ast/closing-parenthesis.yaml +0 -5
  29. data/testdata/ast/empty-alternation.yaml +0 -8
  30. data/testdata/ast/empty-alternations.yaml +0 -9
  31. data/testdata/ast/empty-string.yaml +0 -3
  32. data/testdata/ast/escaped-alternation.yaml +0 -5
  33. data/testdata/ast/escaped-backslash.yaml +0 -5
  34. data/testdata/ast/escaped-opening-parenthesis.yaml +0 -5
  35. data/testdata/ast/escaped-optional-followed-by-optional.yaml +0 -15
  36. data/testdata/ast/escaped-optional-phrase.yaml +0 -10
  37. data/testdata/ast/escaped-optional.yaml +0 -7
  38. data/testdata/ast/opening-brace.yaml +0 -8
  39. data/testdata/ast/opening-parenthesis.yaml +0 -8
  40. data/testdata/ast/optional-containing-nested-optional.yaml +0 -15
  41. data/testdata/ast/optional-phrase.yaml +0 -12
  42. data/testdata/ast/optional.yaml +0 -7
  43. data/testdata/ast/parameter.yaml +0 -7
  44. data/testdata/ast/phrase.yaml +0 -9
  45. data/testdata/ast/unfinished-parameter.yaml +0 -8
  46. data/testdata/expression/allows-escaped-optional-parameter-types.yaml +0 -4
  47. data/testdata/expression/allows-parameter-type-in-alternation-1.yaml +0 -4
  48. data/testdata/expression/allows-parameter-type-in-alternation-2.yaml +0 -4
  49. data/testdata/expression/does-allow-parameter-adjacent-to-alternation.yaml +0 -5
  50. data/testdata/expression/does-not-allow-alternation-in-optional.yaml +0 -9
  51. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-left-parameter.yaml +0 -10
  52. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-optional.yaml +0 -9
  53. data/testdata/expression/does-not-allow-alternation-with-empty-alternative-by-adjacent-right-parameter.yaml +0 -9
  54. data/testdata/expression/does-not-allow-alternation-with-empty-alternative.yaml +0 -9
  55. data/testdata/expression/does-not-allow-empty-optional.yaml +0 -9
  56. data/testdata/expression/does-not-allow-nested-optional.yaml +0 -8
  57. data/testdata/expression/does-not-allow-optional-parameter-types.yaml +0 -9
  58. data/testdata/expression/does-not-allow-parameter-name-with-reserved-characters.yaml +0 -10
  59. data/testdata/expression/does-not-allow-unfinished-parenthesis-1.yaml +0 -8
  60. data/testdata/expression/does-not-allow-unfinished-parenthesis-2.yaml +0 -8
  61. data/testdata/expression/does-not-allow-unfinished-parenthesis-3.yaml +0 -8
  62. data/testdata/expression/does-not-match-misquoted-string.yaml +0 -4
  63. data/testdata/expression/doesnt-match-float-as-int.yaml +0 -5
  64. data/testdata/expression/matches-alternation.yaml +0 -4
  65. data/testdata/expression/matches-anonymous-parameter-type.yaml +0 -5
  66. data/testdata/expression/matches-double-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
  67. data/testdata/expression/matches-double-quoted-empty-string-as-empty-string.yaml +0 -4
  68. data/testdata/expression/matches-double-quoted-string-with-escaped-double-quote.yaml +0 -4
  69. data/testdata/expression/matches-double-quoted-string-with-single-quotes.yaml +0 -4
  70. data/testdata/expression/matches-double-quoted-string.yaml +0 -4
  71. data/testdata/expression/matches-doubly-escaped-parenthesis.yaml +0 -4
  72. data/testdata/expression/matches-doubly-escaped-slash-1.yaml +0 -4
  73. data/testdata/expression/matches-doubly-escaped-slash-2.yaml +0 -4
  74. data/testdata/expression/matches-escaped-parenthesis-1.yaml +0 -4
  75. data/testdata/expression/matches-escaped-parenthesis-2.yaml +0 -4
  76. data/testdata/expression/matches-escaped-parenthesis-3.yaml +0 -4
  77. data/testdata/expression/matches-escaped-slash.yaml +0 -4
  78. data/testdata/expression/matches-float-1.yaml +0 -5
  79. data/testdata/expression/matches-float-2.yaml +0 -5
  80. data/testdata/expression/matches-int.yaml +0 -5
  81. data/testdata/expression/matches-multiple-double-quoted-strings.yaml +0 -4
  82. data/testdata/expression/matches-multiple-single-quoted-strings.yaml +0 -4
  83. data/testdata/expression/matches-optional-before-alternation-1.yaml +0 -4
  84. data/testdata/expression/matches-optional-before-alternation-2.yaml +0 -4
  85. data/testdata/expression/matches-optional-before-alternation-with-regex-characters-1.yaml +0 -4
  86. data/testdata/expression/matches-optional-before-alternation-with-regex-characters-2.yaml +0 -4
  87. data/testdata/expression/matches-optional-in-alternation-1.yaml +0 -5
  88. data/testdata/expression/matches-optional-in-alternation-2.yaml +0 -5
  89. data/testdata/expression/matches-optional-in-alternation-3.yaml +0 -5
  90. data/testdata/expression/matches-single-quoted-empty-string-as-empty-string-along-with-other-strings.yaml +0 -4
  91. data/testdata/expression/matches-single-quoted-empty-string-as-empty-string.yaml +0 -4
  92. data/testdata/expression/matches-single-quoted-string-with-double-quotes.yaml +0 -4
  93. data/testdata/expression/matches-single-quoted-string-with-escaped-single-quote.yaml +0 -4
  94. data/testdata/expression/matches-single-quoted-string.yaml +0 -4
  95. data/testdata/expression/matches-word.yaml +0 -4
  96. data/testdata/expression/throws-unknown-parameter-type.yaml +0 -10
  97. data/testdata/regex/alternation-with-optional.yaml +0 -2
  98. data/testdata/regex/alternation.yaml +0 -2
  99. data/testdata/regex/empty.yaml +0 -2
  100. data/testdata/regex/escape-regex-characters.yaml +0 -2
  101. data/testdata/regex/optional.yaml +0 -2
  102. data/testdata/regex/parameter.yaml +0 -2
  103. data/testdata/regex/text.yaml +0 -2
  104. data/testdata/regex/unicode.yaml +0 -2
  105. data/testdata/tokens/alternation-phrase.yaml +0 -13
  106. data/testdata/tokens/alternation.yaml +0 -9
  107. data/testdata/tokens/empty-string.yaml +0 -6
  108. data/testdata/tokens/escape-non-reserved-character.yaml +0 -8
  109. data/testdata/tokens/escaped-alternation.yaml +0 -9
  110. data/testdata/tokens/escaped-char-has-start-index-of-text-token.yaml +0 -9
  111. data/testdata/tokens/escaped-end-of-line.yaml +0 -8
  112. data/testdata/tokens/escaped-optional.yaml +0 -7
  113. data/testdata/tokens/escaped-parameter.yaml +0 -7
  114. data/testdata/tokens/escaped-space.yaml +0 -7
  115. data/testdata/tokens/optional-phrase.yaml +0 -13
  116. data/testdata/tokens/optional.yaml +0 -9
  117. data/testdata/tokens/parameter-phrase.yaml +0 -13
  118. data/testdata/tokens/parameter.yaml +0 -9
  119. data/testdata/tokens/phrase.yaml +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 835681a50d84da6545175902b2bf1a087dad9eee4e59a7dd946fa21573871d2b
4
- data.tar.gz: 0df216f515832aacec2287b393c0654a0fc7e973251d0dbc56821e17275cd244
3
+ metadata.gz: a32df17b80432aa451bc8f8d5822dfa3b919e44a3feefd657d6dffc730ca56c4
4
+ data.tar.gz: 12157d0f708a0eaff7b0fc6ad1afb0b68668dfdfd87a370091466cae29d3fcfe
5
5
  SHA512:
6
- metadata.gz: eb76f7f7165bbe2e4cc0bdd3d1b708c242dec2f094a8e7d2714fb53f46f6eeb2573f00da459de6e80fb88b0f5b333322fbd4ef6f07c5ac7b3b7de39f8881b0db
7
- data.tar.gz: 997efe8372e077bde04cc119f1a2fce63a1b4c0cee6b6160536d507dab3abc897e5db5e0f864cd4114275feca7353cf9f862a70ad2996e6ce4e408b1e844bd4b
6
+ metadata.gz: 95c6db3127e8a2111ec7f50b06dab07443649e2fd1f759818552df4ac24ec715bd8fb4aad2bd79b3e8054d88dc9751594c75880fa3c15b06f000c82dd88bb37e
7
+ data.tar.gz: 59ba7dabc703d4b3f4ce6e0d319c0275dfa1dc78b0589544a51f5a070f8a3c6c183dcf0bfa60dbac168209944ee9f5ce95a7ed280f4b5f5f28c817b84b40a937
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # Cucumber Expressions for Ruby
2
2
 
3
- [The docs are here](https://cucumber.io/docs/cucumber/cucumber-expressions/).
3
+ [The docs are here](https://github.com/cucumber/cucumber-expressions#readme).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.1.3
1
+ 14.0.0
@@ -9,10 +9,6 @@ module Cucumber
9
9
  @parameter_type_registry = parameter_type_registry
10
10
  end
11
11
 
12
- def generate_expression(text)
13
- generate_expressions(text)[0]
14
- end
15
-
16
12
  def generate_expressions(text)
17
13
  parameter_type_combinations = []
18
14
  parameter_type_matchers = create_parameter_type_matchers(text)
@@ -19,7 +19,7 @@ module Cucumber
19
19
  ### [generate-expression]
20
20
  generator = CucumberExpressionGenerator.new(parameter_registry)
21
21
  undefined_step_text = "I have 2 cucumbers and 1.5 tomato"
22
- generated_expression = generator.generate_expression(undefined_step_text)
22
+ generated_expression = generator.generate_expressions(undefined_step_text)[0]
23
23
  expect(generated_expression.source).to eq("I have {int} cucumbers and {float} tomato")
24
24
  expect(generated_expression.parameter_types[1].type).to eq(Float)
25
25
  ### [generate-expression]
@@ -93,7 +93,7 @@ module Cucumber
93
93
  end
94
94
 
95
95
  it "exposes parameters in generated expression" do
96
- expression = @generator.generate_expression("I have 2 cukes and 1.5 euro")
96
+ expression = @generator.generate_expressions("I have 2 cukes and 1.5 euro")[0]
97
97
  types = expression.parameter_types.map(&:type)
98
98
  expect(types).to eq([Integer, Float])
99
99
  end
@@ -175,18 +175,18 @@ module Cucumber
175
175
  end
176
176
 
177
177
  it "at the beginning of a word" do
178
- expect(@generator.generate_expression("When I download a picture").source).not_to eq("When I {direction}load a picture")
179
- expect(@generator.generate_expression("When I download a picture").source).to eq("When I download a picture")
178
+ expect(@generator.generate_expressions("When I download a picture")[0].source).not_to eq("When I {direction}load a picture")
179
+ expect(@generator.generate_expressions("When I download a picture")[0].source).to eq("When I download a picture")
180
180
  end
181
181
 
182
182
  it "inside a word" do
183
- expect(@generator.generate_expression("When I watch the muppet show").source).not_to eq("When I watch the m{direction}pet show")
184
- expect(@generator.generate_expression("When I watch the muppet show").source).to eq("When I watch the muppet show")
183
+ expect(@generator.generate_expressions("When I watch the muppet show")[0].source).not_to eq("When I watch the m{direction}pet show")
184
+ expect(@generator.generate_expressions("When I watch the muppet show")[0].source).to eq("When I watch the muppet show")
185
185
  end
186
186
 
187
187
  it "at the end of a word" do
188
- expect(@generator.generate_expression("When I create a group").source).not_to eq("When I create a gro{direction}")
189
- expect(@generator.generate_expression("When I create a group").source).to eq("When I create a group")
188
+ expect(@generator.generate_expressions("When I create a group")[0].source).not_to eq("When I create a gro{direction}")
189
+ expect(@generator.generate_expressions("When I create a group")[0].source).to eq("When I create a group")
190
190
  end
191
191
  end
192
192
 
@@ -203,19 +203,19 @@ module Cucumber
203
203
  end
204
204
 
205
205
  it "a full word" do
206
- expect(@generator.generate_expression("When I go down the road").source).to eq("When I go {direction} the road")
207
- expect(@generator.generate_expression("When I walk up the hill").source).to eq("When I walk {direction} the hill")
208
- expect(@generator.generate_expression("up the hill, the road goes down").source).to eq("{direction} the hill, the road goes {direction}")
206
+ expect(@generator.generate_expressions("When I go down the road")[0].source).to eq("When I go {direction} the road")
207
+ expect(@generator.generate_expressions("When I walk up the hill")[0].source).to eq("When I walk {direction} the hill")
208
+ expect(@generator.generate_expressions("up the hill, the road goes down")[0].source).to eq("{direction} the hill, the road goes {direction}")
209
209
  end
210
210
 
211
211
  it 'wrapped around punctuation characters' do
212
- expect(@generator.generate_expression("When direction is:down").source).to eq("When direction is:{direction}")
213
- expect(@generator.generate_expression("Then direction is down.").source).to eq("Then direction is {direction}.")
212
+ expect(@generator.generate_expressions("When direction is:down")[0].source).to eq("When direction is:{direction}")
213
+ expect(@generator.generate_expressions("Then direction is down.")[0].source).to eq("Then direction is {direction}.")
214
214
  end
215
215
  end
216
216
 
217
217
  def assert_expression(expected_expression, expected_argument_names, text)
218
- generated_expression = @generator.generate_expression(text)
218
+ generated_expression = @generator.generate_expressions(text)[0]
219
219
  expect(generated_expression.parameter_names).to eq(expected_argument_names)
220
220
  expect(generated_expression.source).to eq(expected_expression)
221
221
 
@@ -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
@@ -36,6 +36,10 @@ module Cucumber
36
36
  expect( match(/hello/, "world") ).to be_nil
37
37
  end
38
38
 
39
+ it "matches empty string when there is an empty string match" do
40
+ expect( match(/^The value equals "([^"]*)"$/, 'The value equals ""') ).to eq([''])
41
+ end
42
+
39
43
  it "matches nested capture group without match" do
40
44
  expect( match(/^a user( named "([^"]*)")?$/, 'a user') ).to eq([nil])
41
45
  end
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: 12.1.3
4
+ version: 14.0.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-01 00:00:00.000000000 Z
11
+ date: 2021-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -56,20 +56,13 @@ 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
- - Makefile
67
62
  - README.md
68
63
  - Rakefile
69
64
  - VERSION
70
65
  - cucumber-cucumber-expressions.gemspec
71
- - default.mk
72
- - examples.txt
73
66
  - lib/cucumber/cucumber_expressions/argument.rb
74
67
  - lib/cucumber/cucumber_expressions/ast.rb
75
68
  - lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb
@@ -96,113 +89,11 @@ files:
96
89
  - spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
97
90
  - spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
98
91
  - spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
99
- - spec/cucumber/cucumber_expressions/expression_examples_spec.rb
100
92
  - spec/cucumber/cucumber_expressions/expression_factory_spec.rb
101
93
  - spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
102
94
  - spec/cucumber/cucumber_expressions/parameter_type_spec.rb
103
95
  - spec/cucumber/cucumber_expressions/regular_expression_spec.rb
104
96
  - 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
97
  homepage: https://github.com/cucumber/cucumber-expressions-ruby#readme
207
98
  licenses:
208
99
  - MIT
@@ -228,10 +119,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
119
  - !ruby/object:Gem::Version
229
120
  version: '0'
230
121
  requirements: []
231
- rubygems_version: 3.1.2
122
+ rubygems_version: 3.2.22
232
123
  signing_key:
233
124
  specification_version: 4
234
- summary: cucumber-expressions-12.1.3
125
+ summary: cucumber-expressions-14.0.0
235
126
  test_files:
236
127
  - spec/capture_warnings.rb
237
128
  - spec/cucumber/cucumber_expressions/argument_spec.rb
@@ -241,7 +132,6 @@ test_files:
241
132
  - spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb
242
133
  - spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb
243
134
  - spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb
244
- - spec/cucumber/cucumber_expressions/expression_examples_spec.rb
245
135
  - spec/cucumber/cucumber_expressions/expression_factory_spec.rb
246
136
  - spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb
247
137
  - 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/Makefile DELETED
@@ -1 +0,0 @@
1
- include default.mk
data/default.mk DELETED
@@ -1,93 +0,0 @@
1
- SHELL := /usr/bin/env bash
2
- RUBY_SOURCE_FILES = $(shell find . -name "*.rb")
3
- GEMSPEC = $(shell find . -name "*.gemspec")
4
- LIBNAME := $(shell basename $$(dirname $$(pwd)))
5
- GEM := cucumber-$(LIBNAME)-$(NEW_VERSION).gem
6
- IS_TESTDATA = $(findstring -testdata,${CURDIR})
7
-
8
- # https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
9
- rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
10
-
11
- default: .tested
12
- .PHONY: default
13
-
14
- .deps: Gemfile.lock
15
- touch $@
16
-
17
- Gemfile.lock: Gemfile $(GEMSPEC)
18
- bundle install
19
- touch $@
20
-
21
- .tested: .deps $(RUBY_SOURCE_FILES)
22
- bundle exec rspec --color
23
- touch $@
24
-
25
- update-dependencies:
26
- ./scripts/update-gemspec
27
- .PHONY: update-dependencies
28
-
29
- ifdef NEW_VERSION
30
- ifneq (,$(GEMSPEC))
31
- gem: $(GEM)
32
- else
33
- gem:
34
- @echo "Not building gem because there is no gemspec"
35
- endif
36
- endif
37
- .PHONY: gem
38
-
39
- $(GEM): .tested
40
- gem build $(GEMSPEC)
41
- test -s "$(GEM)" || { echo "Gem not built: $(GEM)"; exit 1; }
42
-
43
- remove-local-dependencies:
44
- cat Gemfile | sed 's/^gem /#gem /' > Gemfile.tmp
45
- mv Gemfile.tmp Gemfile
46
- .PHONY: remove-local-dependencies
47
-
48
- pre-release: remove-local-dependencies update-version update-dependencies gem
49
- .PHONY: pre-release
50
-
51
- update-version:
52
- ifeq ($(IS_TESTDATA),-testdata)
53
- # no-op
54
- else
55
- ifdef NEW_VERSION
56
- @echo "$(NEW_VERSION)" > VERSION
57
- endif
58
- endif
59
- .PHONY: update-version
60
-
61
- publish: gem
62
- ifeq ($(IS_TESTDATA),-testdata)
63
- # no-op
64
- else
65
- ifneq (,$(GEMSPEC))
66
- gem push $(GEM)
67
- else
68
- @echo "Not publishing because there is no gemspec"
69
- endif
70
- endif
71
- .PHONY: publish
72
-
73
- post-release:
74
- cat Gemfile | sed 's/^#gem /gem /' > Gemfile.tmp
75
- mv Gemfile.tmp Gemfile
76
- .PHONY: post-release
77
-
78
- clean: clean-ruby
79
- .PHONY: clean
80
-
81
- clean-ruby:
82
- rm -rf .deps .linked .tested* Gemfile.lock *.gem acceptance
83
- .PHONY: clean-ruby
84
-
85
- ### COMMON stuff for all platforms
86
-
87
- BERP_VERSION = 1.3.0
88
- BERP_GRAMMAR = gherkin.berp
89
-
90
- define berp-generate-parser =
91
- -! dotnet tool list --tool-path /usr/bin | grep "berp\s*$(BERP_VERSION)" && dotnet tool update Berp --version $(BERP_VERSION) --tool-path /usr/bin
92
- berp -g $(BERP_GRAMMAR) -t $< -o $@ --noBOM
93
- endef
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
- ]}