Struct assert_cmd::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; Command::new("cat") .arg("-A") .with_stdin() .buffer("42") .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 path
s 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; Command::new("cat") .arg("-A") .with_stdin() .path("Cargo.toml") .unwrap() .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>