Crate assert_cmd[][src]

Assert process::Command - Easy command initialization and assertions.

[dependencies]
assert_cmd = "0.3"

Example

Here's a trivial example:

This example is not tested
extern crate assert_cmd;

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

fn main() {
    let mut cmd = Command::main_binary().unwrap();
    cmd.assert().success();
}

Relevant crates

Other crates that might be useful in testing command line programs.

  • duct for orchestrating multiple processes.
  • assert_fs for filesystem fixtures and assertions.
  • dir-diff for testing file side-effects.
  • tempfile for scratchpad directories.

Modules

cargo

Simplify running bins in a Cargo project.

prelude

Extension traits that are useful to have available.

Structs

Assert

Assert the state of an Output.

OutputError

Command error.

StdInCommand

Command that carries the stdin buffer.

Traits

CommandStdInExt

Write to stdin of a Command.

IntoCodePredicate

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

OutputAssertExt

Assert the state of an Output.

OutputOkExt

Convert an Output to a OutputResult.

Type Definitions

OutputResult

std::process::Output represented as a Result.