Function assert_cli::assert_cli_error [] [src]

pub fn assert_cli_error<S>(cmd: &str, args: &[S], error_code: Option<i32>) -> Result<OutputBox<Error>> where S: AsRef<OsStr>

Assert a CLI call that fails with a given error code.

To test that

bash -c $BLACK_BOX

fails with an exit code of 42.

you would call it like this:

assert_cli::assert_cli_error("bash", &["-c", BLACK_BOX], Some(42));