Struct assert_cli::OutputAssertionBuilder
[−]
[src]
#[must_use]pub struct OutputAssertionBuilder { /* fields omitted */ }
Assertions for command output.
Methods
impl OutputAssertionBuilder[src]
pub fn contains<O: Into<Content>>(self, output: O) -> Assert[src]
Expect the command's output to contain output.
Examples
extern crate assert_cli; assert_cli::Assert::command(&["echo", "42"]) .stdout().contains("42") .unwrap();
pub fn is<O: Into<Content>>(self, output: O) -> Assert[src]
Expect the command to output exactly this output.
Examples
extern crate assert_cli; assert_cli::Assert::command(&["echo", "42"]) .stdout().is("42") .unwrap();
pub fn doesnt_contain<O: Into<Content>>(self, output: O) -> Assert[src]
Expect the command's output to not contain output.
Examples
extern crate assert_cli; assert_cli::Assert::command(&["echo", "42"]) .stdout().doesnt_contain("73") .unwrap();
pub fn isnt<O: Into<Content>>(self, output: O) -> Assert[src]
Expect the command to output to not be exactly this output.
Examples
extern crate assert_cli; assert_cli::Assert::command(&["echo", "42"]) .stdout().isnt("73") .unwrap();
pub fn satisfies<F, M>(self, pred: F, msg: M) -> Assert where
F: 'static + Fn(&str) -> bool,
M: Into<String>, [src]
F: 'static + Fn(&str) -> bool,
M: Into<String>,
Expect the command output to satisfy the given predicate.
Examples
extern crate assert_cli; assert_cli::Assert::command(&["echo", "-n", "42"]) .stdout().satisfies(|x| x.len() == 2, "bad length") .unwrap();