Struct assert_cli::OutputAssertionBuilder[][src]

#[must_use]
pub struct OutputAssertionBuilder { /* fields omitted */ }

Assertions for command output.

Methods

impl OutputAssertionBuilder
[src]

Expect the command's output to contain output.

Examples

extern crate assert_cli;

assert_cli::Assert::command(&["echo", "42"])
    .stdout().contains("42")
    .unwrap();

Expect the command to output exactly this output.

Examples

extern crate assert_cli;

assert_cli::Assert::command(&["echo", "42"])
    .stdout().is("42")
    .unwrap();

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();

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();

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();

Trait Implementations

impl Debug for OutputAssertionBuilder
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations