forked from cucumber/cucumber-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwork_in_progress.feature
156 lines (118 loc) · 3.85 KB
/
work_in_progress.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Feature: Cucumber --work-in-progress switch
In order to ensure that feature scenarios do not pass until they are expected to
Developers should be able to run cucumber in a mode that
- will fail if any scenario passes completely
- will not fail otherwise
Background: A passing and a pending feature
Given a standard Cucumber project directory structure
Given a file named "features/wip.feature" with:
"""
Feature: WIP
@failing
Scenario: Failing
Given a failing step
@undefined
Scenario: Undefined
Given an undefined step
@pending
Scenario: Pending
Given a pending step
@passing
Scenario: Passing
Given a passing step
"""
And a file named "features/passing_outline.feature" with:
"""
Feature: Not WIP
Scenario Outline: Passing
Given a <what> step
Examples:
| what |
| passing |
"""
And a file named "features/step_definitions/steps.rb" with:
"""
Given /^a failing step$/ do
raise "I fail"
end
Given /^a passing step$/ do
end
Given /^a pending step$/ do
pending
end
"""
Scenario: Pass with Failing Scenarios
When I run cucumber -q -w -t @failing features/wip.feature
Then STDERR should be empty
Then it should pass with
"""
Feature: WIP
@failing
Scenario: Failing
Given a failing step
I fail (RuntimeError)
./features/step_definitions/steps.rb:2:in `/^a failing step$/'
features/wip.feature:4:in `Given a failing step'
Failing Scenarios:
cucumber features/wip.feature:3
1 scenario (1 failed)
1 step (1 failed)
The --wip switch was used, so the failures were expected. All is good.
"""
Scenario: Pass with Undefined Scenarios
When I run cucumber -q -w -t @undefined features/wip.feature
Then it should pass with
"""
Feature: WIP
@undefined
Scenario: Undefined
Given an undefined step
1 scenario (1 undefined)
1 step (1 undefined)
The --wip switch was used, so the failures were expected. All is good.
"""
Scenario: Pass with Undefined Scenarios
When I run cucumber -q -w -t @pending features/wip.feature
Then it should pass with
"""
Feature: WIP
@pending
Scenario: Pending
Given a pending step
TODO (Cucumber::Pending)
./features/step_definitions/steps.rb:9:in `/^a pending step$/'
features/wip.feature:12:in `Given a pending step'
1 scenario (1 pending)
1 step (1 pending)
The --wip switch was used, so the failures were expected. All is good.
"""
Scenario: Fail with Passing Scenarios
When I run cucumber -q -w -t @passing features/wip.feature
Then it should fail with
"""
Feature: WIP
@passing
Scenario: Passing
Given a passing step
1 scenario (1 passed)
1 step (1 passed)
The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
(::) passed scenarios (::)
features/wip.feature:15:in `Scenario: Passing'
"""
Scenario: Fail with Passing Scenario Outline
When I run cucumber -q -w features/passing_outline.feature
Then it should fail with
"""
Feature: Not WIP
Scenario Outline: Passing
Given a <what> step
Examples:
| what |
| passing |
1 scenario (1 passed)
1 step (1 passed)
The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
(::) passed scenarios (::)
features/passing_outline.feature:7:in `| passing |'
"""