-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathstrict_mode.feature
70 lines (57 loc) · 1.84 KB
/
strict_mode.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Feature: Strict mode
Using the `--strict` flag will cause cucumber to fail unless all the
step definitions have been defined.
Background:
Given a file named "features/missing.feature" with:
"""
Feature: Missing
Scenario: Missing
Given this step passes
"""
And a file named "features/pending.feature" with:
"""
Feature: Pending
Scenario: Pending
Given this step is pending
"""
Scenario: Fail with --strict due to undefined step
When I run `cucumber -q features/missing.feature --strict`
Then it should fail with:
"""
Feature: Missing
Scenario: Missing
Given this step passes
Undefined step: "this step passes" (Cucumber::Core::Test::Result::Undefined)
features/missing.feature:3:in `this step passes'
Undefined Scenarios:
cucumber features/missing.feature:2
1 scenario (1 undefined)
1 step (1 undefined)
"""
Scenario: Fail with --strict due to pending step
Given the standard step definitions
When I run `cucumber -q features/pending.feature --strict`
Then it should fail with:
"""
Feature: Pending
Scenario: Pending
Given this step is pending
TODO (Cucumber::Pending)
./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
features/pending.feature:3:in `this step is pending'
Pending Scenarios:
cucumber features/pending.feature:2
1 scenario (1 pending)
1 step (1 pending)
"""
Scenario: Succeed with --strict
Given the standard step definitions
When I run `cucumber -q features/missing.feature --strict`
Then it should pass with:
"""
Feature: Missing
Scenario: Missing
Given this step passes
1 scenario (1 passed)
1 step (1 passed)
"""