[][src]Trait assert_cmd::cmd::OutputOkExt

pub trait OutputOkExt where
    Self: Sized
{ fn ok(self) -> OutputResult; fn unwrap(self) -> Output { ... }
fn unwrap_err(self) -> OutputError { ... } }

Converts a type to an OutputResult.

This is for example implemented on std::process::Output.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let result = Command::new("echo")
    .args(&["42"])
    .ok();
assert!(result.is_ok());

Required methods

fn ok(self) -> OutputResult

Convert an Output to an OutputResult.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let result = Command::new("echo")
    .args(&["42"])
    .ok();
assert!(result.is_ok());
Loading content...

Provided methods

fn unwrap(self) -> Output

Unwrap a Output but with a prettier message than .ok().unwrap().

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let output = Command::new("echo")
    .args(&["42"])
    .unwrap();

fn unwrap_err(self) -> OutputError

Unwrap a Output but with a prettier message than ok().err().unwrap().

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let err = Command::new("a-command")
    .args(&["--will-fail"])
    .unwrap_err();
Loading content...

Implementations on Foreign Types

impl OutputOkExt for Output[src]

impl<'c> OutputOkExt for &'c mut Command[src]

Loading content...

Implementors

impl<'c, 'a> OutputOkExt for &'c mut StdInCommand<'a>[src]

Loading content...