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 UnsafeUnpin 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