@@ -154,7 +154,7 @@ impl Assert {
154
154
self
155
155
}
156
156
157
- /// Ensure the command returned the expected code.
157
+ /// Ensure the command aborted before returning a code.
158
158
pub fn interrupted ( self ) -> Self {
159
159
if self . output . status . code ( ) . is_some ( ) {
160
160
panic ! ( "Unexpected completion\n {}" , self ) ;
@@ -166,7 +166,7 @@ impl Assert {
166
166
///
167
167
/// # Examples
168
168
///
169
- /// ```rust,ignore
169
+ /// ```rust
170
170
/// use assert_cmd::prelude::*;
171
171
///
172
172
/// use std::process::Command;
@@ -176,12 +176,6 @@ impl Assert {
176
176
/// .env("exit", "42")
177
177
/// .assert()
178
178
/// .code(42);
179
- /// // which is equivalent to
180
- /// Command::main_binary()
181
- /// .unwrap()
182
- /// .env("exit", "42")
183
- /// .assert()
184
- /// .code(predicates::ord::eq(42));
185
179
/// ```
186
180
pub fn code < I , P > ( self , pred : I ) -> Self
187
181
where
@@ -206,7 +200,7 @@ impl Assert {
206
200
///
207
201
/// # Examples
208
202
///
209
- /// ```rust,ignore
203
+ /// ```rust
210
204
/// use assert_cmd::prelude::*;
211
205
///
212
206
/// use std::process::Command;
@@ -216,7 +210,7 @@ impl Assert {
216
210
/// .env("stdout", "hello")
217
211
/// .env("stderr", "world")
218
212
/// .assert()
219
- /// .stdout(predicates::ord::eq(b "hello") );
213
+ /// .stdout("hello\n" );
220
214
/// ```
221
215
pub fn stdout < I , P > ( self , pred : I ) -> Self
222
216
where
@@ -240,7 +234,7 @@ impl Assert {
240
234
///
241
235
/// # Examples
242
236
///
243
- /// ```rust,ignore
237
+ /// ```rust
244
238
/// use assert_cmd::prelude::*;
245
239
///
246
240
/// use std::process::Command;
@@ -250,7 +244,7 @@ impl Assert {
250
244
/// .env("stdout", "hello")
251
245
/// .env("stderr", "world")
252
246
/// .assert()
253
- /// .stderr(predicates::ord::eq(b "world") );
247
+ /// .stderr("world\n" );
254
248
/// ```
255
249
pub fn stderr < I , P > ( self , pred : I ) -> Self
256
250
where
@@ -349,11 +343,12 @@ where
349
343
}
350
344
}
351
345
352
- impl < P > IntoOutputPredicate < predicates:: str:: Utf8Predicate < P > > for P
353
- where
354
- P : predicates:: Predicate < str > ,
346
+ impl IntoOutputPredicate < predicates:: str:: Utf8Predicate < predicates:: ord:: EqPredicate < & ' static str > > >
347
+ for & ' static str
355
348
{
356
- fn into_output ( self ) -> predicates:: str:: Utf8Predicate < P > {
357
- self . from_utf8 ( )
349
+ fn into_output (
350
+ self ,
351
+ ) -> predicates:: str:: Utf8Predicate < predicates:: ord:: EqPredicate < & ' static str > > {
352
+ predicates:: ord:: eq ( self ) . from_utf8 ( )
358
353
}
359
354
}
0 commit comments