cucumber-cucumber-expressions 12.1.3 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abdf3cd3e3ef1625435edf7a0c7076c148deb20f311f3c1f25f02cd7b4f4085d
|
4
|
+
data.tar.gz: 545703ed396856e7775307a49746dc2fdb4a2bba7aa732d9960b90d83976a155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 449a4b0ccc31d0398bea421da4cb5ff5f6be6daf437bd819a46e238c26c63989e18a32ed6e9e3fc71e099757e837bb04e9be1834b74852da39fc5b1b1581fe71
|
7
|
+
data.tar.gz: 699da85cd5fdd9851b021b9505da384c80047cf6b12d2b3b9abebf189199f4952db2331328cbed1d9bab9d1c69478f34e8a46f463fa8f951eecb364bc2444857
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
13.0.1
|
@@ -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.
|
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.
|
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.
|
179
|
-
expect(@generator.
|
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.
|
184
|
-
expect(@generator.
|
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.
|
189
|
-
expect(@generator.
|
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.
|
207
|
-
expect(@generator.
|
208
|
-
expect(@generator.
|
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.
|
213
|
-
expect(@generator.
|
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.
|
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
|
|
@@ -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:
|
4
|
+
version: 13.0.1
|
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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -231,7 +231,7 @@ requirements: []
|
|
231
231
|
rubygems_version: 3.1.2
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
|
-
summary: cucumber-expressions-
|
234
|
+
summary: cucumber-expressions-13.0.1
|
235
235
|
test_files:
|
236
236
|
- spec/capture_warnings.rb
|
237
237
|
- spec/cucumber/cucumber_expressions/argument_spec.rb
|