[][src]Trait assert_cmd::assert::IntoCodePredicate

pub trait IntoCodePredicate<P> where
    P: Predicate<i32>, 
{ type Predicate; fn into_code(self) -> P; }

Used by Assert::code to convert Self into the needed Predicate<i32>.

Examples

use assert_cmd::prelude::*;

use std::process::Command;
use predicates::prelude::*;

Command::cargo_bin("bin_fixture")
    .unwrap()
    .env("exit", "42")
    .assert()
    .code(predicate::eq(42));

// which can be shortened to:
Command::cargo_bin("bin_fixture")
    .unwrap()
    .env("exit", "42")
    .assert()
    .code(42);

Associated Types

type Predicate

The type of the predicate being returned.

Loading content...

Required methods

fn into_code(self) -> P

Convert to a predicate for testing a program's exit code.

Loading content...

Implementations on Foreign Types

impl IntoCodePredicate<EqCodePredicate> for i32[src]

impl IntoCodePredicate<InCodePredicate> for Vec<i32>[src]

impl IntoCodePredicate<InCodePredicate> for &'static [i32][src]

Loading content...

Implementors

impl<P> IntoCodePredicate<P> for P where
    P: Predicate<i32>, 
[src]

type Predicate = P

Loading content...