@@ -318,38 +318,30 @@ pub fn run_in_tmpdir<F: FnOnce()>(callback: F) {
318
318
}
319
319
320
320
/// Implement common helpers for command wrappers. This assumes that the command wrapper is a struct
321
- /// containing a `cmd: Command` field and a `output` function . The provided helpers are:
321
+ /// containing a `cmd: Command` field. The provided helpers are:
322
322
///
323
323
/// 1. Generic argument acceptors: `arg` and `args` (delegated to [`Command`]). These are intended
324
324
/// to be *fallback* argument acceptors, when specific helpers don't make sense. Prefer to add
325
325
/// new specific helper methods over relying on these generic argument providers.
326
326
/// 2. Environment manipulation methods: `env`, `env_remove` and `env_clear`: these delegate to
327
327
/// methods of the same name on [`Command`].
328
- /// 3. Output and execution: `output`, ` run` and `run_fail` are provided. `output` waits for the
329
- /// command to finish running and returns the process's [`Output`]. `run` and `run_fail` are
330
- /// higher-level convenience methods which waits for the command to finish running and assert
331
- /// that the command successfully ran or failed as expected. Prefer `run` and `run_fail` when
332
- /// possible .
328
+ /// 3. Output and execution: `run` and `run_fail` are provided. These are
329
+ /// higher-level convenience methods which wait for the command to finish running and assert
330
+ /// that the command successfully ran or failed as expected. They return
331
+ /// [`CompletedProcess`], which can be used to assert the stdout/stderr/exit code of the executed
332
+ /// process .
333
333
///
334
334
/// Example usage:
335
335
///
336
336
/// ```ignore (illustrative)
337
337
/// struct CommandWrapper { cmd: Command } // <- required `cmd` field
338
338
///
339
- /// impl CommandWrapper {
340
- /// /// Get the [`Output`][::std::process::Output] of the finished process.
341
- /// pub fn command_output(&mut self) -> Output { /* ... */ } // <- required `command_output()` method
342
- /// }
343
- ///
344
339
/// crate::impl_common_helpers!(CommandWrapper);
345
340
///
346
341
/// impl CommandWrapper {
347
342
/// // ... additional specific helper methods
348
343
/// }
349
344
/// ```
350
- ///
351
- /// [`Command`]: ::std::process::Command
352
- /// [`Output`]: ::std::process::Output
353
345
macro_rules! impl_common_helpers {
354
346
( $wrapper: ident) => {
355
347
impl $wrapper {
0 commit comments