Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate on documentation #93

Merged
merged 4 commits into from Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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