This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
announce.feature
283 lines (256 loc) · 6.41 KB
/
announce.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
Feature: Announce output during test run
In order to specify expected output
As a developer using Cucumber
I want to use the "the output should contain" step
Background:
Given I use a fixture named "cli-app"
Scenario: Announce change of directory (deprecated)
Given a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-dir
Scenario: Run command
Given a directory named "dir.d"
When I cd to "dir.d"
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
$ cd /
"""
And the output should contain:
"""
tmp/aruba/dir.d
"""
Scenario: Announce change of directory
Given a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-directory
Scenario: Run command
Given a directory named "dir.d"
When I cd to "dir.d"
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
$ cd /
"""
And the output should contain:
"""
tmp/aruba/dir.d
"""
Scenario: Announce stdout
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-stdout
Scenario: Run command
When I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
<<-STDOUT
Hello World
STDOUT
"""
Scenario: Announce stderr
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World' >&2
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-stderr
Scenario: Run command
When I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
<<-STDERR
Hello World
STDERR
"""
Scenario: Announce both stderr and stdout
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello' >&2
echo 'World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-output
Scenario: Run command
When I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
<<-STDERR
Hello
STDERR
"""
And the output should contain:
"""
<<-STDOUT
World
STDOUT
"""
Scenario: Announce command
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-cmd
Scenario: Run command
When I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
$ cli
"""
Scenario: Announce change of environment variable
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-env
Scenario: Run command
When I set the environment variables to:
| variable | value |
| MY_VAR | my_value |
And I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
$ export MY_VAR=my_value
"""
Scenario: Announce change of environment variable which contains special characters
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-env
Scenario: Run command
When I set the environment variables to:
| variable | value |
| MY_VAR | my value ! |
And I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
$ export MY_VAR=my\ value\ \
"""
Scenario: Announce file system status of command
This will output information like owner, group, atime, mtime, ctime, size,
mode and if command is executable.
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-command-filesystem-status
Scenario: Run command
And I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
# mode => 755
"""
And the output should contain:
"""
# owner
"""
And the output should contain:
"""
# group
"""
And the output should contain:
"""
# ctime
"""
And the output should contain:
"""
# mtime
"""
And the output should contain:
"""
# atime
"""
And the output should contain:
"""
# size
"""
And the output should contain:
"""
# executable
"""
Scenario: Announce content of command
This will output the content of the executable command. Be careful doing
this with binary executables. This hook should be used with scripts only.
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo 'Hello World'
"""
And a file named "features/exit_status.feature" with:
"""cucumber
Feature: Announce
@announce-command-content
Scenario: Run command
And I run `cli`
Then the exit status should be 0
"""
When I run `cucumber`
Then the features should all pass
And the output should contain:
"""
#!/usr/bin/env bash
echo 'Hello World'
"""