Trait assert_cmd::assert::IntoOutputPredicate [−][src]
Used by Assert::stdout
and Assert::stderr
to convert Self
into the needed [predicates_core::Predicate<[u8]>
].
Examples
use assert_cmd::prelude::*; use std::process::Command; use predicates::prelude::*; Command::cargo_bin("bin_fixture") .unwrap() .env("stdout", "hello") .env("stderr", "world") .assert() .stdout(predicate::str::similar("hello\n").from_utf8()); // which can be shortened to: Command::cargo_bin("bin_fixture") .unwrap() .env("stdout", "hello") .env("stderr", "world") .assert() .stdout("hello\n");
Associated Types
Loading content...Required methods
fn into_output(self) -> P
[src]
Convert to a predicate for testing a path.
Implementations on Foreign Types
impl IntoOutputPredicate<BytesContentOutputPredicate> for Vec<u8>
[src]
type Predicate = BytesContentOutputPredicate
fn into_output(self) -> Self::Predicate
[src]
impl IntoOutputPredicate<BytesContentOutputPredicate> for &'static [u8]
[src]
type Predicate = BytesContentOutputPredicate
fn into_output(self) -> Self::Predicate
[src]
impl IntoOutputPredicate<StrContentOutputPredicate> for String
[src]
type Predicate = StrContentOutputPredicate
fn into_output(self) -> Self::Predicate
[src]
impl IntoOutputPredicate<StrContentOutputPredicate> for &'static str
[src]
type Predicate = StrContentOutputPredicate
fn into_output(self) -> Self::Predicate
[src]
Implementors
impl<P> IntoOutputPredicate<StrOutputPredicate<P>> for P where
P: Predicate<str>,
[src]
P: Predicate<str>,
type Predicate = StrOutputPredicate<P>
fn into_output(self) -> Self::Predicate
[src]
impl<P> IntoOutputPredicate<P> for P where
P: Predicate<[u8]>,
[src]
P: Predicate<[u8]>,