From 3e260e7bd78d7b300f5a1060d7f1ab76fe42ddeb Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 5 Jul 2018 18:31:34 -0600 Subject: [PATCH] Mark assert_cli as deprecated --- Cargo.toml | 1 + README.md | 78 ++++-------------------------------------------------- 2 files changed, 6 insertions(+), 73 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 147d4d6..09181b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,3 +27,4 @@ docmatic = "0.1" [badges] travis-ci = { repository = "assert-rs/assert_cli" } +maintenance = { status = "deprecated" } diff --git a/README.md b/README.md index 4c97d37..7f9aad2 100644 --- a/README.md +++ b/README.md @@ -7,76 +7,10 @@ ![License](https://img.shields.io/crates/l/assert_cli.svg) [![crates.io](https://img.shields.io/crates/v/assert_cli.svg)][Crates.io] -## Install +Note: `assert_cli`, in its current form, is deprecated. The spiritual +successor to `assert_cli` is [`assert_cmd`][assert_cmd]. -For your tests, add it to your `Cargo.toml`: - -```toml -[dev-dependencies] -assert_cli = "0.6" -``` - -## Example - -Here's a trivial example: - -```rust,ignore -extern crate assert_cli; - -fn main() { - assert_cli::Assert::main_binary().unwrap(); -} -``` - -And here is one that will fail (and demonstrates running arbitrary commands): - -```rust -extern crate assert_cli; - -fn main() { - assert_cli::Assert::command(&["ls", "foo-bar-foo"]) - .fails() - .and() - .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`): - -```rust,should_panic -#[macro_use] extern crate assert_cli; - -fn main() { - assert_cmd!(wc "README.md") - .stdout().is("1337 README.md") - .unwrap(); -} -``` - -... which has the benefit to show a nice, colorful diff in your terminal, -like this: - -```diff --1337 -+92 -``` - -**Tip**: Enclose arguments in the `assert_cmd!` macro in quotes `"`, - if there are special characters, which the macro doesn't accept, e.g. - `assert_cmd!(cat "foo.txt")`. - -Assert Cli use [Environment][Environment] underneath to deal with environment variables. - -More detailed information is available in the [documentation]. :-) - -## Relevant crates - -Other crates that might be useful in testing command line programs. -* [dir-diff][dir-diff] for testing file side-effects. -* [tempfile][tempfile] for scratchpad directories. -* [duct][duct] for orchestrating multiple processes. +Stayed tuned to [Issue #41][future] for our reinventing `assert_cli` on top of `assert_cmd`. ## License @@ -97,7 +31,5 @@ conditions. [Travis]: https://travis-ci.org/assert-rs/assert_cli [Crates.io]: https://crates.io/crates/assert_cli [Documentation]: https://docs.rs/assert_cli -[Environment]: https://github.com/Freyskeyd/environment -[dir-diff]: https://crates.io/crates/dir-diff -[tempfile]: https://crates.io/crates/tempfile -[duct]: https://crates.io/crates/duct +[assert_cmd]: https://crates.io/crates/assert_cmd +[future]: https://github.com/assert-rs/assert_cli/issues/41