Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

WIP: Free fns for Output constructors and add prelude #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,27 @@ And here is one that will fail (and demonstrates running arbitrary commands):

```rust
extern crate assert_cli;
use assert_cli::prelude::*;

fn main() {
assert_cli::Assert::command(&["ls", "foo-bar-foo"])
Assert::command(&["ls", "foo-bar-foo"])
.fails()
.and()
.stderr().contains("foo-bar-foo")
.stderr(contains("foo-bar-foo"))
.unwrap();
}
```

If you want to match the program's output _exactly_, you can use
`stdout().is` (and shows the macro form of `command`):
`Output::is` (and shows the macro form of `command`):

```rust,should_panic
#[macro_use] extern crate assert_cli;
use assert_cli::prelude::*;

fn main() {
assert_cmd!(wc "README.md")
.stdout().is("1337 README.md")
.stdout(is("1337 README.md"))
.unwrap();
}
```
Expand Down
Loading