cucumber-expressions 5.0.15 → 5.0.16

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
- SHA1:
3
- metadata.gz: 53f59f8751aaff37ff7ce670ab926087741ab71c
4
- data.tar.gz: db6d41818d1ccf957541022c4e204b2212c523d7
2
+ SHA256:
3
+ metadata.gz: 3ec8af84d4cb8b2d1c099e2329c59b3a02e9a6b74e2fe41709b5d337e7126f2a
4
+ data.tar.gz: 03bb66e968f2e0544958c105e4ff9def0f8579b4bf2f0fb2a26403f9bd95e790
5
5
  SHA512:
6
- metadata.gz: 7e16dcab6cfaa8903977eaa469d6e3a334a6be6685bfceecd08573cd35948d9d4587897cf1420c87d39d394236dd56b68f8edfbe4596c05fb14ab1671c6825bf
7
- data.tar.gz: 03c140cb987f97743c3a53f97eb0c01cd53c41425eacc985d6667e8303f04cdc2c947cbe24a24056ead70ab6800c513b853fab9cc71696ae6115c83fbba7893b
6
+ metadata.gz: 736d0d6e20355ac8dbc433c7d5e976dcccd422d33485ec141931bd1ca4f90c5e9d74c5e8ae9282bb2fedd9db332e02310ed554c120de743312bbc8c564328375
7
+ data.tar.gz: 7ea16575a99faaacfa248963941eafaac3913804b3ec0cba93a6c02c1f59b7f1332719afe004652bf0a368e7e9c7c3d9d2ed0ef3ecd9da9d2e4bceee2d62677a
@@ -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.15'
4
+ s.version = '5.0.16'
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}"
@@ -11,7 +11,7 @@ module Cucumber
11
11
  end
12
12
 
13
13
  def values
14
- (children.empty? ? [self] : children).map(&:value)
14
+ (children.empty? ? [self] : children).map(&:value).compact
15
15
  end
16
16
  end
17
17
  end
@@ -35,16 +35,7 @@ module Cucumber
35
35
  end
36
36
 
37
37
  def transform(self_obj, group_values)
38
- if @transformer.arity == 1
39
- non_nil_group_values = group_values.compact
40
- raise CucumberExpressionError.new(
41
- "Single transformer unexpectedly matched 2 values - \"#{non_nil_group_values[0]}\" and \"#{non_nil_group_values[1]}\""
42
- ) if non_nil_group_values.length >= 2
43
- args = [non_nil_group_values[0]]
44
- else
45
- args = group_values
46
- end
47
- self_obj.instance_exec(*args, &@transformer)
38
+ self_obj.instance_exec(*group_values, &@transformer)
48
39
  end
49
40
 
50
41
  def <=>(other)
@@ -23,7 +23,7 @@ module Cucumber
23
23
  parameter_type_regexp,
24
24
  parameter_type_regexp,
25
25
  String,
26
- lambda {|s| s},
26
+ lambda {|*s| s[0]},
27
27
  false,
28
28
  false
29
29
  )
@@ -40,6 +40,14 @@ module Cucumber
40
40
  expect( match(/hello/, "world") ).to be_nil
41
41
  end
42
42
 
43
+ it "matches nested capture group without match" do
44
+ expect( match(/^a user( named "([^"]*)")?$/, 'a user') ).to eq([nil])
45
+ end
46
+
47
+ it "matches nested capture group with match" do
48
+ expect( match(/^a user( named "([^"]*)")?$/, 'a user named "Charlie"') ).to eq(['Charlie'])
49
+ end
50
+
43
51
  it "ignores non capturing groups" do
44
52
  expect( match(
45
53
  /(\S+) ?(can|cannot) (?:delete|cancel) the (\d+)(?:st|nd|rd|th) (attachment|slide) ?(?:upload)?/,
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.15
4
+ version: 5.0.16
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-08 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,10 +128,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.8
131
+ rubygems_version: 2.7.6
132
132
  signing_key:
133
133
  specification_version: 4
134
- summary: cucumber-expressions-5.0.15
134
+ summary: cucumber-expressions-5.0.16
135
135
  test_files:
136
136
  - spec/capture_warnings.rb
137
137
  - spec/coverage.rb