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()
.current_dir("/tmp")
.unwrap();
---- test stdout ----
thread 'test' panicked at 'Assertion failed for `cargo run --quiet --`
with: Unexpected return status: failure
stdout=``````
stderr=``````'
Since it is executed "--quiet", there is no output in stderr but returns a failure status.
Can we get the binary
assert_cli version: 0.6.2
- Rust version: 1.26.2
- OS and version: OS X 10.13