Struct assert_cmd::assert::AssertError
source · pub struct AssertError { /* private fields */ }
Expand description
Assert
error (see AssertResult
).
Implementations§
source§impl AssertError
impl AssertError
sourcepub fn assert(self) -> Assert
pub fn assert(self) -> Assert
Returns the Assert
wrapped into the Result
produced by
the try_
variants of the Assert
methods.
§Examples
use assert_cmd::prelude::*;
use std::process::Command;
use predicates::prelude::*;
let result = Command::new("echo")
.assert();
match result.try_success() {
Ok(assert) => {
assert.stdout(predicate::eq(b"Success\n" as &[u8]));
}
Err(err) => {
err.assert().stdout(predicate::eq(b"Err but some specific output you might want to check\n" as &[u8]));
}
}
Trait Implementations§
source§impl Debug for AssertError
impl Debug for AssertError
source§impl Display for AssertError
impl Display for AssertError
source§impl Error for AssertError
impl Error for AssertError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AssertError
impl !RefUnwindSafe for AssertError
impl Send for AssertError
impl Sync for AssertError
impl Unpin for AssertError
impl !UnwindSafe for AssertError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more