forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstderr.feature
68 lines (63 loc) · 2.13 KB
/
stderr.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
Feature: STDERR of commands which were executed
In order to specify expected output
As a developer using Cucumber
I want to use the "the stderr should contain" step
Background:
Given I use a fixture named "cli-app"
Scenario: Detect stderr from all processes
Given a file named "features/output.feature" with:
"""
Feature: Run command
Scenario: Run command
When I run `bash -c 'printf "hello world!\n" >&2'`
And I run `bash -c 'cat >&2 '` interactively
And I type "hola"
And I type ""
Then the stderr should contain:
\"\"\"
hello world!
\"\"\"
And the stderr should contain:
\"\"\"
hola
\"\"\"
And the stdout should not contain anything
"""
When I run `cucumber`
Then the features should all pass
Scenario: Detect stderr from all processes (deprecated)
Given a file named "features/output.feature" with:
"""
Feature: Run command
Scenario: Run command
When I run `bash -c 'printf "hello world!\n" >&2'`
And I run `bash -c 'cat >&2 '` interactively
And I type "hola"
And I type ""
Then the stderr should contain:
\"\"\"
hello world!
hola
\"\"\"
And the stdout should not contain anything
"""
When I run `cucumber`
Then the features should all pass
Scenario: Detect stderr from named source
Given a file named "features/output.feature" with:
"""
Feature: Run command
Scenario: Run command
When I run `bash -c 'printf hello >&2'`
And I run `printf goodbye`
Then the stderr from "bash -c 'printf hello >&2'" should contain "hello"
And the stderr from "bash -c 'printf hello >&2'" should contain exactly "hello"
And the stderr from "bash -c 'printf hello >&2'" should contain exactly:
\"\"\"
hello
\"\"\"
And the stdout from "bash -c 'printf hello >&2'" should not contain "hello"
And the stderr from "printf goodbye" should not contain "hello"
"""
When I run `cucumber`
Then the features should all pass