cucumber_factory 1.7.2 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.2
1
+ 1.7.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cucumber_factory}
8
- s.version = "1.7.2"
8
+ s.version = "1.7.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Henning Koch"]
@@ -20,9 +20,11 @@ module Cucumber
20
20
  def step_match_with_factory_priority(*args)
21
21
  step_match_without_factory_priority(*args)
22
22
  rescue Ambiguous => e
23
- matched_definitions = e.matches.collect(&:step_definition)
24
- if matched_definitions.size == 2 && (Cucumber::Factory.step_definitions & matched_definitions).any?
25
- (matched_definitions - Cucumber::Factory.step_definitions).first
23
+ non_factory_matches = e.matches.reject do |match|
24
+ Cucumber::Factory.step_definitions.include?(match.step_definition)
25
+ end
26
+ if non_factory_matches.size == 1
27
+ non_factory_matches.first
26
28
  else
27
29
  raise
28
30
  end
@@ -11,9 +11,11 @@ describe Cucumber::Runtime, 'extended with cucumber_factory' do
11
11
 
12
12
  describe 'step_match' do
13
13
 
14
- it "should not raise an ambiguous step error and return the user step if the only other matching step is a factory step" do
14
+ it "should not raise an ambiguous step error and match the user step if the only other matching step is a factory step" do
15
15
  user_step = @main.Given(/^there is a movie with a funny tone/){}
16
- @runtime.step_match('there is a movie with a funny tone').should == user_step
16
+ match = @runtime.step_match('there is a movie with a funny tone')
17
+ match.step_definition.should == user_step
18
+ match.should be_a(Cucumber::StepMatch)
17
19
  end
18
20
 
19
21
  it "should still raise an ambiguous step error if more than two non-factory steps match" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_factory
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 2
10
- version: 1.7.2
9
+ - 3
10
+ version: 1.7.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch