When working with a lot of feature files in
cucumber you'll sooner or later run in to the problem of having 2 similar statements ie:
Then /^epic .*$/ do
end
Then /^epic fail$/ do
end
If you just run cucumber <feature file> with this definition it will fail with the following error:
Ambiguous match of "epic fail". To solve this problem just add --guess on the command line (cucumber --guess <feature file>). What
happens is that the cucumber runner does a bit of evaluating to decide what method to call, so far it has worked as expected.
Files needed to test:
* fail.feature:
Feature: Fail
In order to test this
I want a feature file that contains a test
Scenario:
Given a dummy
When a win
Then epic win
Scenario:
Given a dummy
When an epic fail
Then epic fail
* fail_step.rb
Given /^a dummy$/ do
end
When /^a win$/ do
end
When /^an epic fail$/ do
end
Then /^epic .*$/ do
end
Then /^epic fail$/ do
end