Trait assert_cmd::prelude::CommandCargoExt[][src]

pub trait CommandCargoExt where
    Self: Sized
{ fn main_binary() -> Result<Self, Error>;
fn cargo_bin<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>;
fn cargo_example<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>; }

Extend Command with helpers for running the current crate's binaries.

Required Methods

Create a Command to run the crate's main binary.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

Command::main_binary()
    .unwrap()
    .unwrap();

Create a Command to run a specific binary of the current crate.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

Command::cargo_bin("bin_fixture")
    .unwrap()
    .unwrap();

Create a Command to run a specific example of the current crate.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

Command::cargo_example("example_fixture")
    .unwrap()
    .unwrap();

Implementations on Foreign Types

impl CommandCargoExt for Command
[src]

Run the crate's main binary.

Note: only works if there one bin in the crate.

Run a specific binary of the current crate.

Run a specific example of the current crate.

Implementors