Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 206 lines (173 sloc) 5.7 kb
853e9aa @dchelimsky output detection feature
authored
1 Feature: Output
2
3 In order to specify expected output
4 As a developer using Cucumber
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
5 I want to use the "the output should contain" step
853e9aa @dchelimsky output detection feature
authored
6
ca536ee @aslakhellesoy Added a new feature
aslakhellesoy authored
7 Scenario: Run unknown command
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
8 When I run `neverever gonna work`
ca536ee @aslakhellesoy Added a new feature
aslakhellesoy authored
9 Then the output should contain:
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
10 """
11 No such file or directory - neverever
12 """
ca536ee @aslakhellesoy Added a new feature
aslakhellesoy authored
13
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
14 Scenario: Detect subset of one-line output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
15 When I run `ruby -e 'puts \"hello world\"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
16 Then the output should contain "hello world"
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
17
01b7c80 @aslakhellesoy Get coverage back to 100%
aslakhellesoy authored
18 Scenario: Detect subset of one-line output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
19 When I run `echo 'hello world'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
20 Then the output should contain "hello world"
01b7c80 @aslakhellesoy Get coverage back to 100%
aslakhellesoy authored
21
e4e5204 @dchelimsky add a couple more negative steps
authored
22 Scenario: Detect absence of one-line output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
23 When I run `ruby -e 'puts \"hello world\"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
24 Then the output should not contain "good-bye"
e4e5204 @dchelimsky add a couple more negative steps
authored
25
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
26 Scenario: Detect subset of multiline output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
27 When I run `ruby -e 'puts \"hello\\nworld\"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
28 Then the output should contain:
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
29 """
30 hello
31 """
e4e5204 @dchelimsky add a couple more negative steps
authored
32
33 Scenario: Detect subset of multiline output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
34 When I run `ruby -e 'puts \"hello\\nworld\"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
35 Then the output should not contain:
e4e5204 @dchelimsky add a couple more negative steps
authored
36 """
37 good-bye
38 """
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
39
40 Scenario: Detect exact one-line output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
41 When I run `ruby -e 'puts \"hello world\"'`
9b28f15 @aslakhellesoy Quotes and newlines no longer escaped. Use pystring if you need newlines...
aslakhellesoy authored
42 Then the output should contain exactly:
43 """
44 hello world
45
46 """
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
47
48 Scenario: Detect exact multiline output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
49 When I run `ruby -e 'puts "hello\nworld"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
50 Then the output should contain exactly:
6b44351 @dchelimsky support partial and exact string matches (single or multiline)
authored
51 """
52 hello
53 world
54
55 """
277588a @aslakhellesoy combined step for partial output and exit status (passing)
aslakhellesoy authored
56
a3685d7 @aslakhellesoy More tags
aslakhellesoy authored
57 @announce
2dc8e02 @robertwahler add "I should see matching" for regex in partial_output
robertwahler authored
58 Scenario: Detect subset of one-line output with regex
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
59 When I run `ruby --version`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
60 Then the output should contain "ruby"
61 And the output should match /ruby ([\d]+\.[\d]+\.[\d]+)(p\d+)? \(.*$/
2dc8e02 @robertwahler add "I should see matching" for regex in partial_output
robertwahler authored
62
0d96f1b @robertwahler multiline should see matching step allows ".*" to match newlines
robertwahler authored
63 @announce
2dc8e02 @robertwahler add "I should see matching" for regex in partial_output
robertwahler authored
64 Scenario: Detect subset of multiline output with regex
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
65 When I run `ruby -e 'puts "hello\nworld\nextra line1\nextra line2\nimportant line"'`
bbdf052 @aslakhellesoy Change regexen to avoid conflicts with e.g. Cucumber-Rails. This rings b...
aslakhellesoy authored
66 Then the output should match:
2dc8e02 @robertwahler add "I should see matching" for regex in partial_output
robertwahler authored
67 """
68 he..o
69 wor.d
0d96f1b @robertwahler multiline should see matching step allows ".*" to match newlines
robertwahler authored
70 .*
71 important line
2dc8e02 @robertwahler add "I should see matching" for regex in partial_output
robertwahler authored
72 """
73
74 @announce
7a53e62 @aslakhellesoy clean up generated files
aslakhellesoy authored
75 Scenario: Match passing exit status and partial output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
76 When I run `ruby -e 'puts "hello\nworld"'`
277588a @aslakhellesoy combined step for partial output and exit status (passing)
aslakhellesoy authored
77 Then it should pass with:
78 """
79 hello
80 """
7a53e62 @aslakhellesoy clean up generated files
aslakhellesoy authored
81
f683404 @aslakhellesoy Added /it should pass with exactly:/
aslakhellesoy authored
82 Scenario: Match passing exit status and exact output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
83 When I run `ruby -e 'puts "hello\nworld"'`
f683404 @aslakhellesoy Added /it should pass with exactly:/
aslakhellesoy authored
84 Then it should pass with exactly:
85 """
86 hello
87 world
f36dfe2 @aslakhellesoy Fix stupid bug
aslakhellesoy authored
88
f683404 @aslakhellesoy Added /it should pass with exactly:/
aslakhellesoy authored
89 """
90
a3685d7 @aslakhellesoy More tags
aslakhellesoy authored
91 @announce-stdout
7a53e62 @aslakhellesoy clean up generated files
aslakhellesoy authored
92 Scenario: Match failing exit status and partial output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
93 When I run `ruby -e 'puts \"hello\\nworld\";exit 99'`
7a53e62 @aslakhellesoy clean up generated files
aslakhellesoy authored
94 Then it should fail with:
95 """
96 hello
97 """
a3685d7 @aslakhellesoy More tags
aslakhellesoy authored
98
1cca0f2 @aslakhellesoy Added /^the stderr should contain exactly:"$/ and /^the stdout should co...
aslakhellesoy authored
99 Scenario: Match failing exit status and exact output
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
100 When I run `ruby -e 'puts "hello\nworld";exit 99'`
1cca0f2 @aslakhellesoy Added /^the stderr should contain exactly:"$/ and /^the stdout should co...
aslakhellesoy authored
101 Then it should fail with exactly:
102 """
103 hello
104 world
105
106 """
107
2d5e941 Add step definition to allow matching pass|fail output against regex
Arve Knudsen authored
108 @announce-stdout
109 Scenario: Match failing exit status and output with regex
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
110 When I run `ruby -e 'puts \"hello\\nworld\";exit 99'`
2d5e941 Add step definition to allow matching pass|fail output against regex
Arve Knudsen authored
111 Then it should fail with regex:
112 """
113 hello\s*world
114 """
115
a3685d7 @aslakhellesoy More tags
aslakhellesoy authored
116 @announce-cmd
6e5a6b4 @aslakhellesoy generalize 'I should see' to combined streams
aslakhellesoy authored
117 Scenario: Match output in stdout
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
118 When I run `ruby -e 'puts \"hello\\nworld\"'`
6e5a6b4 @aslakhellesoy generalize 'I should see' to combined streams
aslakhellesoy authored
119 Then the stdout should contain "hello"
120 Then the stderr should not contain "hello"
121
a7729a7 @aslakhellesoy New stepdef Then /^the stdout should contain:$/ do |partial_output|
aslakhellesoy authored
122 @announce
123 Scenario: Match output on several lines
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
124 When I run `ruby -e 'puts %{GET /}'`
a7729a7 @aslakhellesoy New stepdef Then /^the stdout should contain:$/ do |partial_output|
aslakhellesoy authored
125 Then the stdout should contain:
126 """
127 GET /
128 """
129
82019cd @aslakhellesoy Quotes (") and newline (\n) in step arguments no longer need to be backs...
aslakhellesoy authored
130 Scenario: Match output on several lines using quotes
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
131 When I run `ruby -e 'puts %{GET "/"}'`
82019cd @aslakhellesoy Quotes (") and newline (\n) in step arguments no longer need to be backs...
aslakhellesoy authored
132 Then the stdout should contain:
133 """
134 GET "/"
135 """
136
a7729a7 @aslakhellesoy New stepdef Then /^the stdout should contain:$/ do |partial_output|
aslakhellesoy authored
137 Scenario: Match output in stdout
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
138 When I run `ruby -e 'puts \"hello\\nworld\"'`
a7729a7 @aslakhellesoy New stepdef Then /^the stdout should contain:$/ do |partial_output|
aslakhellesoy authored
139 Then the stdout should contain "hello"
140 Then the stderr should not contain "hello"
edc6d32 @msassak Failing WIP, cucumber.yml for WIP and scenarios for future work
msassak authored
141
b6cf671 @msassak Clarify scenario names
msassak authored
142 Scenario: Detect output from all processes
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
143 When I run `ruby -e 'puts \"hello world!\"'`
144 And I run `ruby -e 'puts gets.chomp.reverse'` interactively
edc6d32 @msassak Failing WIP, cucumber.yml for WIP and scenarios for future work
msassak authored
145 And I type "hello"
146 Then the output should contain exactly:
147 """
148 hello world!
29e5f0a @msassak Detect combined output from running a regular and interactive process in
msassak authored
149 olleh
5764062 @msassak Simplify, cleanup output handling
msassak authored
150
edc6d32 @msassak Failing WIP, cucumber.yml for WIP and scenarios for future work
msassak authored
151 """
152
b6cf671 @msassak Clarify scenario names
msassak authored
153 Scenario: Detect stdout from all processes
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
154 When I run `ruby -e 'puts \"hello world!\"'`
155 And I run `ruby -e 'puts gets.chomp.reverse'` interactively
4b0b2d3 @msassak WIP detecting combined stdout
msassak authored
156 And I type "hello"
9b28f15 @aslakhellesoy Quotes and newlines no longer escaped. Use pystring if you need newlines...
aslakhellesoy authored
157 Then the stdout should contain:
158 """
159 hello world!
160 olleh
161 """
162 And the stderr should not contain:
163 """
164 hello world!
165 olleh
166 """
4b0b2d3 @msassak WIP detecting combined stdout
msassak authored
167
b6cf671 @msassak Clarify scenario names
msassak authored
168 Scenario: Detect stderr from all processes
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
169 When I run `ruby -e 'STDERR.puts \"hello world!\"'`
170 And I run `ruby -e 'STDERR.puts gets.chomp.reverse'` interactively
a6596f2 @msassak Detect output included in all stderr
msassak authored
171 And I type "hello"
9b28f15 @aslakhellesoy Quotes and newlines no longer escaped. Use pystring if you need newlines...
aslakhellesoy authored
172 Then the stderr should contain:
173 """
174 hello world!
175 olleh
176 """
177 And the stdout should not contain:
178 """
179 hello world!
180 olleh
181 """
a6596f2 @msassak Detect output included in all stderr
msassak authored
182
edc6d32 @msassak Failing WIP, cucumber.yml for WIP and scenarios for future work
msassak authored
183 Scenario: Detect output from named source
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
184 When I run `ruby -e 'puts :simple'`
185 And I run `ruby -e 'puts gets.chomp'` interactively
bdfa441 @msassak WIP detecting output from named source
msassak authored
186 And I type "interactive"
187 Then the output from "ruby -e 'puts :simple'" should contain "simple"
188 And the output from "ruby -e 'puts gets.chomp'" should not contain "simple"
189
1391cfd @msassak Detect stdout from a named source
msassak authored
190 Scenario: Detect stdout from named source
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
191 When I run `ruby -e 'puts :hello'`
192 And I run `ruby -e 'puts :goodbye'`
1391cfd @msassak Detect stdout from a named source
msassak authored
193 Then the stdout from "ruby -e 'puts :hello'" should contain "hello"
194 And the stderr from "ruby -e 'puts :hello'" should not contain "hello"
195 And the stdout from "ruby -e 'puts :goodbye'" should not contain "hello"
196
edc6d32 @msassak Failing WIP, cucumber.yml for WIP and scenarios for future work
msassak authored
197 Scenario: Detect stderr from named source
cd06c78 @aslakhellesoy Use backticks (`) instead of quotes (") to specify command line. Quote s...
aslakhellesoy authored
198 When I run `ruby -e 'STDERR.puts :hello'`
199 And I run `ruby -e 'puts :goodbye'`
b62c1c9 @msassak Detect STDERR from named source
msassak authored
200 Then the stderr from "ruby -e 'STDERR.puts :hello'" should contain "hello"
201 And the stdout from "ruby -e 'STDERR.puts :hello'" should not contain "hello"
202 And the stderr from "ruby -e 'puts :goodbye'" should not contain "hello"
203
52e92a5 @msassak Mark custom names scenario wip
msassak authored
204 @wip
b62c1c9 @msassak Detect STDERR from named source
msassak authored
205 Scenario: Detect output from named source with custom name
Something went wrong with that request. Please try again.