Struct assert_cmd::stdin::StdInCommandBuilder [−][src]
pub struct StdInCommandBuilder<'a> { /* fields omitted */ }For adding a stdin to a Command.
Methods
impl<'a> StdInCommandBuilder<'a>[src]
impl<'a> StdInCommandBuilder<'a>pub fn buffer<S>(&mut self, buffer: S) -> StdInCommand where
S: Into<Vec<u8>>, [src]
pub fn buffer<S>(&mut self, buffer: S) -> StdInCommand where
S: Into<Vec<u8>>, Write buffer to stdin when the Command is run.
Examples
use assert_cmd::prelude::*; use std::process::Command; let mut cmd = Command::new("cat"); cmd .arg("-A") .with_stdin() .buffer("42"); let output = cmd.unwrap();
pub fn path<P>(&mut self, file: P) -> Result<StdInCommand> where
P: AsRef<Path>, [src]
pub fn path<P>(&mut self, file: P) -> Result<StdInCommand> where
P: AsRef<Path>, Write paths content to stdin when the Command is run.
Paths are relative to the env::current_dir and not
Command::current_dir.
Examples
use assert_cmd::prelude::*; use std::process::Command; let mut cmd = Command::new("cat"); cmd .arg("-A") .with_stdin() .path("Cargo.toml") .unwrap(); let output = cmd.unwrap();
Trait Implementations
impl<'a> Debug for StdInCommandBuilder<'a>[src]
impl<'a> Debug for StdInCommandBuilder<'a>Auto Trait Implementations
impl<'a> Send for StdInCommandBuilder<'a>
impl<'a> Send for StdInCommandBuilder<'a>impl<'a> Sync for StdInCommandBuilder<'a>
impl<'a> Sync for StdInCommandBuilder<'a>