cucumber-expressions 5.0.17 → 5.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +5 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +5 -0
- data/.rsync +1 -0
- data/.subrepo +1 -0
- data/.travis.yml +5 -5
- data/cucumber-expressions.gemspec +1 -1
- data/lib/cucumber/cucumber_expressions/cucumber_expression.rb +4 -1
- data/lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb +1 -0
- data/spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb +10 -1
- data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +4 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d661edfcc1203904d6471736027ab45c6036ec6a4015347ca190a7397b9a18f0
|
4
|
+
data.tar.gz: 5aefbf1fbc78226c404a23b39131e966bcdac8f621711ab6b3b9997d23f4bd1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 727ad5c75d452c0ad4b549045cbb2cfc15dc4cd5bc8e0b34333dd4d176969cac8960b780ce452927bca5c81cfdba7e2faff31c3ca0d7c21ac56688ced0b4e981
|
7
|
+
data.tar.gz: 6e1a3dc1fe998cd396278f48a0fcd410e2bbe5b8e6eb35a43aea857c70f74391dda987106b4b7b13b40da0f512f2eb5b165897cf20dafb64e9c60c5db28833d5
|
data/.rsync
CHANGED
data/.subrepo
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
cucumber/cucumber-expressions-ruby.git
|
data/.travis.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'cucumber-expressions'
|
4
|
-
s.version = '5.0.
|
4
|
+
s.version = '5.0.18'
|
5
5
|
s.authors = ["Aslak Hellesøy"]
|
6
6
|
s.description = 'Cucumber Expressions - a simpler alternative to Regular Expressions'
|
7
7
|
s.summary = "cucumber-expressions-#{s.version}"
|
@@ -55,7 +55,10 @@ module Cucumber
|
|
55
55
|
|
56
56
|
def process_alternation(expression)
|
57
57
|
expression.gsub(ALTERNATIVE_NON_WHITESPACE_TEXT_REGEXP) do
|
58
|
-
|
58
|
+
# replace \/ with /
|
59
|
+
# replace / with |
|
60
|
+
replacement = $&.tr('/', '|').gsub(/\\\|/, '/')
|
61
|
+
"(?:#{replacement})"
|
59
62
|
end
|
60
63
|
end
|
61
64
|
|
@@ -41,6 +41,12 @@ module Cucumber
|
|
41
41
|
"{iii}")
|
42
42
|
end
|
43
43
|
|
44
|
+
it "generates expression with escaped slashes" do
|
45
|
+
assert_expression(
|
46
|
+
"The {int}\\/{int}\\/{int} hey", ["int", "int2", "int3"],
|
47
|
+
"The 1814/05/17 hey")
|
48
|
+
end
|
49
|
+
|
44
50
|
it "generates expression for int float arg" do
|
45
51
|
assert_expression(
|
46
52
|
"I have {int} cukes and {float} euro", ["int", "float"],
|
@@ -53,7 +59,7 @@ module Cucumber
|
|
53
59
|
'I like "bangers" and \'mash\'')
|
54
60
|
end
|
55
61
|
|
56
|
-
it "generates expression
|
62
|
+
it "generates expression with % sign" do
|
57
63
|
assert_expression(
|
58
64
|
"I am {int}% foobar", ["int"],
|
59
65
|
'I am 20% foobar')
|
@@ -121,6 +127,9 @@ module Cucumber
|
|
121
127
|
|
122
128
|
cucumber_expression = CucumberExpression.new(generated_expression.source, @parameter_type_registry)
|
123
129
|
match = cucumber_expression.match(text)
|
130
|
+
if match.nil?
|
131
|
+
raise "Expected text '#{text}' to match generated expression '#{generated_expression.source}'"
|
132
|
+
end
|
124
133
|
expect(match.length).to eq(expected_argument_names.length)
|
125
134
|
end
|
126
135
|
end
|
@@ -59,6 +59,10 @@ module Cucumber
|
|
59
59
|
expect(match('three \\(exceptionally) {string} mice', 'three (exceptionally) "blind" mice')).to eq(['blind'])
|
60
60
|
end
|
61
61
|
|
62
|
+
it "matches escaped slash" do
|
63
|
+
expect(match("12\\/2020", "12/2020")).to eq([])
|
64
|
+
end
|
65
|
+
|
62
66
|
it "matches int" do
|
63
67
|
expect(match("{int}", "22")).to eq([22])
|
64
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-expressions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.18
|
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: 2018-
|
11
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,8 +72,11 @@ executables: []
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
+
- ".github/ISSUE_TEMPLATE.md"
|
76
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
75
77
|
- ".rspec"
|
76
78
|
- ".rsync"
|
79
|
+
- ".subrepo"
|
77
80
|
- ".travis.yml"
|
78
81
|
- Gemfile
|
79
82
|
- LICENSE
|
@@ -131,7 +134,7 @@ rubyforge_project:
|
|
131
134
|
rubygems_version: 2.7.6
|
132
135
|
signing_key:
|
133
136
|
specification_version: 4
|
134
|
-
summary: cucumber-expressions-5.0.
|
137
|
+
summary: cucumber-expressions-5.0.18
|
135
138
|
test_files:
|
136
139
|
- spec/capture_warnings.rb
|
137
140
|
- spec/coverage.rb
|