/
ambiguous_step.feature
36 lines (32 loc) · 1.06 KB
/
ambiguous_step.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Feature: Ambiguous Steps
Scenario:
Given a file named "features/a.feature" with:
"""
Feature: a feature name
Scenario: a scenario name
Given a ambiguous step
"""
Given a file named "features/step_definitions/cucumber_steps.js" with:
"""
var cucumberSteps = function() {
this.When(/^a ambiguous step$/, function() { });
this.When(/^a (.*) step$/, function(status) { });
};
module.exports = cucumberSteps;
"""
When I run cucumber.js with `-f progress`
Then it outputs this text:
"""
A
Failures:
1) Scenario: a scenario name - features/a.feature:2
Step: Given a ambiguous step - features/a.feature:3
Message:
Multiple step definitions match:
/^a ambiguous step$/ - features/step_definitions/cucumber_steps.js:2
/^a (.*) step$/ - features/step_definitions/cucumber_steps.js:3
1 scenario (1 ambiguous)
1 step (1 ambiguous)
<duration-stat>
"""
And the exit status should be 1