[][src]Macro assert_cmd::crate_name

macro_rules! crate_name {
    () => { ... };
}

Allows you to pull the name from your Cargo.toml at compile time.

Examples

This example panics
use assert_cmd::Command;

fn main() {
    let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
    let assert = cmd
        .arg("-A")
        .env("stdout", "hello")
        .env("exit", "42")
        .write_stdin("42")
        .assert();
    assert
        .failure()
        .code(42)
        .stdout("hello\n");
}