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
fn main_binary() -> Result<Self, Error>
Create a Command
to run the crate's main binary.
Examples
use assert_cmd::prelude::*; use std::process::Command; Command::main_binary() .unwrap() .unwrap();
fn cargo_bin<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
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();
fn cargo_example<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
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]
impl CommandCargoExt for Command
fn main_binary() -> Result<Self, Error>
[src]
fn main_binary() -> Result<Self, Error>
Run the crate's main binary.
Note: only works if there one bin in the crate.
fn cargo_bin<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
[src]
fn cargo_bin<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
Run a specific binary of the current crate.
fn cargo_example<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
[src]
fn cargo_example<S: AsRef<OsStr>>(name: S) -> Result<Self, Error>
Run a specific example of the current crate.