Trait assert_cmd::assert::IntoOutputPredicate [−][src]
pub trait IntoOutputPredicate<P> where
P: Predicate<[u8]>, { type Predicate; fn into_output(self) -> P; }
Used by Assert::stdout and Assert::stderr to convert Self
into the needed Predicate<[u8]>.
Examples
ⓘThis example is not tested
use assert_cmd::prelude::*; use std::process::Command; use predicates::prelude::*; Command::main_binary() .unwrap() .env("stdout", "hello") .env("stderr", "world") .assert() .stdout(predicate::str::similar("hello\n").from_utf8()); // which can be shortened to: Command::main_binary() .unwrap() .env("stdout", "hello") .env("stderr", "world") .assert() .stdout("hello\n");
Associated Types
type Predicate
The type of the predicate being returned.
Required Methods
fn into_output(self) -> P
Convert to a predicate for testing a path.
Implementations on Foreign Types
impl IntoOutputPredicate<BytesContentOutputPredicate> for &'static [u8][src]
impl IntoOutputPredicate<BytesContentOutputPredicate> for &'static [u8]type Predicate = BytesContentOutputPredicate
fn into_output(self) -> Self::Predicate[src]
fn into_output(self) -> Self::Predicateimpl IntoOutputPredicate<StrContentOutputPredicate> for &'static str[src]
impl IntoOutputPredicate<StrContentOutputPredicate> for &'static strtype Predicate = StrContentOutputPredicate
fn into_output(self) -> Self::Predicate[src]
fn into_output(self) -> Self::Predicate