Skip to content

Commit

Permalink
Merge pull request #93 from epage/docs
Browse files Browse the repository at this point in the history
Iterate on documentation
  • Loading branch information
epage committed Mar 26, 2020
2 parents b2d53dd + a57f569 commit 64c4879
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,8 @@
<a name="0.12.2"></a>
## 0.12.2 (2020-03-26)

#### Features

* **cmd**:
* Support timeouts (closes [#10](https://github.com/assert-rs/assert_cmd/issues/20)).

Expand Down
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -7,6 +7,10 @@
![License](https://img.shields.io/crates/l/assert_cmd.svg)
[![Crates Status](https://img.shields.io/crates/v/assert_cmd.svg)](https://crates.io/crates/assert_cmd)

`assert_cmd` aims to simplify the process for doing integration testing of CLIs, including:
- Finding your crate's binary to test
- Assert on the result of your program's run.

## Install

Add to your `Cargo.toml`:
Expand All @@ -27,20 +31,26 @@ let mut cmd = Command::cargo_bin("bin_fixture").unwrap();
cmd.assert().success();
```

See the [docs](http://docs.rs/assert_cmd) for more.

## Relevant crates

Other crates that might be useful in testing command line programs.
* [escargot][escargot] for more control over configurin the crate's binary.
* [duct][duct] for orchestrating multiple processes.
* or [commandspec] for easier writing of commands
* [rexpect][rexpect] for testing interactive programs.
* [`assert_fs`][assert_fs] for filesystem fixtures and assertions.
* or [tempfile][tempfile] for scratchpad directories.
* [dir-diff][dir-diff] for testing file side-effects.
* [tempfile][tempfile] for scratchpad directories.

[escargot]: http://docs.rs/escargot
[rexpect]: https://crates.io/crates/rexpect
[dir-diff]: https://crates.io/crates/dir-diff
[tempfile]: https://crates.io/crates/tempfile
[duct]: https://crates.io/crates/duct
[assert_fs]: https://crates.io/crates/assert_fs
[commandspec]: https://crates.io/crates/commandspec

## License

Expand Down
22 changes: 14 additions & 8 deletions src/lib.rs
@@ -1,8 +1,8 @@
//! **Assert [`Command`]** - Easy command initialization and assertions.
//!
//! `assert_cmd` includes support for:
//! - Setting up your program-under-test.
//! - Verifying your program-under-test.
//! `assert_cmd` aims to simplify the process for doing integration testing of CLIs, including:
//! - Finding your crate's binary to test
//! - Assert on the result of your program's run.
//!
//! ```toml
//! [dependencies]
Expand All @@ -21,6 +21,7 @@
//! - `current_dir`
//! - `env` / `envs` / `env_remove` / `env_clear`
//! - `write_stdin` / `pipe_stdin`
//! - `timeout`
//!
//! Validate a [`Command`]:
//! - `ok` / `unwrap` / `unwrap_err`
Expand All @@ -31,6 +32,7 @@
//! - `code`, see [`Assert`]
//! - `stdout`, see [`Assert`]
//! - `stderr`, see [`Assert`]
//! - `get_output` for everything else, see [`Assert`]
//!
//! Note: [`Command`] is provided as a convenience. Extension traits for [`std::process::Command`]
//! and `Output` are provided for interoperability:
Expand Down Expand Up @@ -72,11 +74,13 @@
//! ## Relevant crates
//!
//! Other crates that might be useful in testing command line programs.
//! - [duct] for orchestrating multiple processes.
//! - [commandspec] for easier writing of commands
//! - [assert_fs] for filesystem fixtures and assertions.
//! - [dir-diff] for testing file side-effects.
//! - [tempfile] for scratchpad directories.
//! * [escargot][escargot] for more control over configurin the crate's binary.
//! * [duct] for orchestrating multiple processes.
//! * or [commandspec] for easier writing of commands
//! * [rexpect][rexpect] for testing interactive programs.
//! * [assert_fs] for filesystem fixtures and assertions.
//! * or [tempfile] for scratchpad directories.
//! * [dir-diff] for testing file side-effects.
//!
//! ## Migrating from `assert_cli` v0.6
//!
Expand All @@ -96,6 +100,8 @@
//! [tempfile]: https://crates.io/crates/tempfile
//! [duct]: https://crates.io/crates/duct
//! [assert_fs]: https://crates.io/crates/assert_fs
//! [escargot]: http://docs.rs/escargot
//! [rexpect]: https://crates.io/crates/rexpect
//! [`Command`]: cmd/struct.Command.html
//! [`std::process::Command`]: https://doc.rust-lang.org/std/process/struct.Command.html
//! [`Assert`]: assert/struct.Assert.html
Expand Down

0 comments on commit 64c4879

Please sign in to comment.