assert_cli
assert_cli copied to clipboard
See instead assert_cmd
@epage asked in : > I'm curious, what do you see needing done before moving this to 1.0? While I should get back to my regularly schedule project, I would...
I have a situation in which I'd like to test the output of things like `myprog | head` and `echo "foobar" | myprog`. Is there a way to accomplish this...
`assert_cli::Assert::main_binary()` will use `cargo run --quiet --` to execute the CLI. However, if setting current directory outside the project (e.g., `/tmp`), `cargo` will not find the corresponding binary. ``` assert_cli::Assert::main_binary()...
I was experimenting and I thought I should share some changes based on the discussion in #106. Key Changes: - Added the `InputPredicate` trait to provide access to Command's stdin...
Need at least one example using `main_binary` and/or `cargo_binary` to actually test a Rust CLI app.
The docs don't show how to test a cli application written in Rust. Like, there are no examples in the documentation that actually show how to do this. The `main_binary`...
I just saw [this announcement][ann] of [duct], which seems to handle a bunch of weird edge cases in relation to `std::process::Command`. [duct]: https://docs.rs/duct [ann]: https://www.reddit.com/r/rust/comments/618jvw/announcing_duct_a_child_process_library_thats/ It looks like we can...
When I'm doing cargo test, I get the following error output (excerpt): ``` ---- src/assert.rs - assert::Assert::fails_with (line 238) stdout ---- thread 'rustc' panicked at 'test executable failed: thread 'main'...
Based on #74, cf. https://github.com/killercup/assert_cli/pull/74#pullrequestreview-72693665 - [x] No, I did not try to fix all the tests this is just a WIP to discuss if we want this
With `rust-1.17.0` or `rust-1.18.0`, I'm get this error on build time: ```rust error: use of unstable library feature 'command_envs' (see issue #38526) --> /Users/behnam/.cargo/registry/src/github.com-1ecc6299db9ec823/assert_cli-0.5.4/src/assert.rs:303:14 | 303 | .envs(self.env.clone().compile()) | ^^^^...
Quoting @sevagh: Just to confirm that I expected the with_env(&vec[("MY_ENV_VAR", "MY_VAL")] to Just Work(TM) and it didn't - I had to use Environment::inherit().insert("MY_ENV_VAR", "MY_VAL"). Previously, I used to use https://doc.rust-lang.org/1.1.0/std/process/struct.Command.html#method.env...