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

Commit e582504

Browse files
authored
Merge pull request #117 from epage/deprecate
Mark assert_cli as deprecated
2 parents faeb524 + 3e260e7 commit e582504

File tree

2 files changed

+6
-73
lines changed

2 files changed

+6
-73
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ docmatic = "0.1"
2727

2828
[badges]
2929
travis-ci = { repository = "assert-rs/assert_cli" }
30+
maintenance = { status = "deprecated" }

README.md

Lines changed: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,10 @@
77
![License](https://img.shields.io/crates/l/assert_cli.svg)
88
[![crates.io](https://img.shields.io/crates/v/assert_cli.svg)][Crates.io]
99

10-
## Install
10+
Note: `assert_cli`, in its current form, is deprecated. The spiritual
11+
successor to `assert_cli` is [`assert_cmd`][assert_cmd].
1112

12-
For your tests, add it to your `Cargo.toml`:
13-
14-
```toml
15-
[dev-dependencies]
16-
assert_cli = "0.6"
17-
```
18-
19-
## Example
20-
21-
Here's a trivial example:
22-
23-
```rust,ignore
24-
extern crate assert_cli;
25-
26-
fn main() {
27-
assert_cli::Assert::main_binary().unwrap();
28-
}
29-
```
30-
31-
And here is one that will fail (and demonstrates running arbitrary commands):
32-
33-
```rust
34-
extern crate assert_cli;
35-
36-
fn main() {
37-
assert_cli::Assert::command(&["ls", "foo-bar-foo"])
38-
.fails()
39-
.and()
40-
.stderr().contains("foo-bar-foo")
41-
.unwrap();
42-
}
43-
```
44-
45-
If you want to match the program's output _exactly_, you can use
46-
`stdout().is` (and shows the macro form of `command`):
47-
48-
```rust,should_panic
49-
#[macro_use] extern crate assert_cli;
50-
51-
fn main() {
52-
assert_cmd!(wc "README.md")
53-
.stdout().is("1337 README.md")
54-
.unwrap();
55-
}
56-
```
57-
58-
... which has the benefit to show a nice, colorful diff in your terminal,
59-
like this:
60-
61-
```diff
62-
-1337
63-
+92
64-
```
65-
66-
**Tip**: Enclose arguments in the `assert_cmd!` macro in quotes `"`,
67-
if there are special characters, which the macro doesn't accept, e.g.
68-
`assert_cmd!(cat "foo.txt")`.
69-
70-
Assert Cli use [Environment][Environment] underneath to deal with environment variables.
71-
72-
More detailed information is available in the [documentation]. :-)
73-
74-
## Relevant crates
75-
76-
Other crates that might be useful in testing command line programs.
77-
* [dir-diff][dir-diff] for testing file side-effects.
78-
* [tempfile][tempfile] for scratchpad directories.
79-
* [duct][duct] for orchestrating multiple processes.
13+
Stayed tuned to [Issue #41][future] for our reinventing `assert_cli` on top of `assert_cmd`.
8014

8115
## License
8216

@@ -97,7 +31,5 @@ conditions.
9731
[Travis]: https://travis-ci.org/assert-rs/assert_cli
9832
[Crates.io]: https://crates.io/crates/assert_cli
9933
[Documentation]: https://docs.rs/assert_cli
100-
[Environment]: https://github.com/Freyskeyd/environment
101-
[dir-diff]: https://crates.io/crates/dir-diff
102-
[tempfile]: https://crates.io/crates/tempfile
103-
[duct]: https://crates.io/crates/duct
34+
[assert_cmd]: https://crates.io/crates/assert_cmd
35+
[future]: https://github.com/assert-rs/assert_cli/issues/41

0 commit comments

Comments
 (0)