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

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

Used by Assert::code to convert Self into the needed predicates_core::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

The type of the predicate being returned.

Required methods

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

Implementations on Foreign Types

Implementors