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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3821d0679b7cfc185225a5760088bbff31d2b5b7a09badabe586eddc5068dbc6
4
- data.tar.gz: 270433a81d721c4e2c25cbe68e0a211f0c9074bbcc85c15e6b96f211ebb62c10
3
+ metadata.gz: d661edfcc1203904d6471736027ab45c6036ec6a4015347ca190a7397b9a18f0
4
+ data.tar.gz: 5aefbf1fbc78226c404a23b39131e966bcdac8f621711ab6b3b9997d23f4bd1f
5
5
  SHA512:
6
- metadata.gz: 14fa6a516bff4c1d48d0646fbd6234f6c28ed109983db31ddbf33d07d2bad21b0193a344f9edcd9805bc67217d57658c87fda343a4bc6b17f6ca82ef0546de27
7
- data.tar.gz: 317ab01474a740676f9dcb81a65dec0d7db38e001dcdfbe1587eac907561d162152b35864bcff11cacf08bd1b5db97a08ee7ad7e5944a51c53296192b3a9e9f8
6
+ metadata.gz: 727ad5c75d452c0ad4b549045cbb2cfc15dc4cd5bc8e0b34333dd4d176969cac8960b780ce452927bca5c81cfdba7e2faff31c3ca0d7c21ac56688ced0b4e981
7
+ data.tar.gz: 6e1a3dc1fe998cd396278f48a0fcd410e2bbe5b8e6eb35a43aea857c70f74391dda987106b4b7b13b40da0f512f2eb5b165897cf20dafb64e9c60c5db28833d5
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,5 @@
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 CHANGED
@@ -1,3 +1,4 @@
1
1
  ../../LICENSE LICENSE
2
+ ../../.templates/github/ .github/
2
3
  ../../.templates/ruby/.travis.yml .travis.yml
3
4
  ../examples.txt examples.txt
data/.subrepo ADDED
@@ -0,0 +1 @@
1
+ cucumber/cucumber-expressions-ruby.git
data/.travis.yml CHANGED
@@ -7,10 +7,10 @@ sudo: false
7
7
  language: ruby
8
8
 
9
9
  rvm:
10
- - "2.5.0"
11
- - "2.4.3"
12
- - "2.3.6"
13
- - "2.2.9"
14
- - "jruby-9.1.13.0"
10
+ - "2.5.1"
11
+ - "2.4.4"
12
+ - "2.3.7"
13
+ - "2.2.10"
14
+ - "jruby-9.1.17.0"
15
15
 
16
16
  script: make default
@@ -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.17'
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
- "(?:#{$1}#{$2.tr('/', '|')})"
58
+ # replace \/ with /
59
+ # replace / with |
60
+ replacement = $&.tr('/', '|').gsub(/\\\|/, '/')
61
+ "(?:#{replacement})"
59
62
  end
60
63
  end
61
64
 
@@ -98,6 +98,7 @@ module Cucumber
98
98
  s.gsub(/%/, '%%')
99
99
  .gsub(/\(/, '\\(')
100
100
  .gsub(/\{/, '\\{')
101
+ .gsub(/\//, '\\/')
101
102
  end
102
103
  end
103
104
  end
@@ -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 for strings with % sign" do
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.17
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-04-12 00:00:00.000000000 Z
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.17
137
+ summary: cucumber-expressions-5.0.18
135
138
  test_files:
136
139
  - spec/capture_warnings.rb
137
140
  - spec/coverage.rb