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 +1 -1
- data/cucumber_factory.gemspec +1 -1
- data/lib/cucumber/runtime_ext.rb +5 -3
- data/spec/runtime_ext_spec.rb +4 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.3
|
data/cucumber_factory.gemspec
CHANGED
data/lib/cucumber/runtime_ext.rb
CHANGED
@@ -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
|
-
|
24
|
-
|
25
|
-
|
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
|
data/spec/runtime_ext_spec.rb
CHANGED
@@ -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
|
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')
|
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:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 1.7.
|
9
|
+
- 3
|
10
|
+
version: 1.7.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|