Trait assert_cmd::stdin::CommandStdInExt
source · pub trait CommandStdInExt {
fn with_stdin(&mut self) -> StdInCommandBuilder<'_>;
}
Expand description
Write to stdin
of a Command
.
Required Methods§
sourcefn with_stdin(&mut self) -> StdInCommandBuilder<'_>
fn with_stdin(&mut self) -> StdInCommandBuilder<'_>
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();