pub struct TestCommand<'a> { /* private fields */ }Expand description
Structure which holds all of the information necessary to run a specific binary and (optionally) check its output for expected values
Implementations§
Source§impl TestCommand<'_>
impl TestCommand<'_>
Sourcepub fn test_result(&self) -> Result<(String, String), Failed>
pub fn test_result(&self) -> Result<(String, String), Failed>
Runs the command as configured and returns the output captured in stdout and stderr
It also checks for the expected values (if set in the builder)
Sourcepub fn test(&self) -> Result<(), Failed>
pub fn test(&self) -> Result<(), Failed>
Convenience method to run TestCommand::test_result but discarding the pipe output
Trait Implementations§
Source§impl<'a> Default for TestCommand<'a>
impl<'a> Default for TestCommand<'a>
Source§fn default() -> TestCommand<'a>
fn default() -> TestCommand<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for TestCommand<'a>
impl<'a> RefUnwindSafe for TestCommand<'a>
impl<'a> Send for TestCommand<'a>
impl<'a> Sync for TestCommand<'a>
impl<'a> Unpin for TestCommand<'a>
impl<'a> UnwindSafe for TestCommand<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more