-
Notifications
You must be signed in to change notification settings - Fork 45
Closed as not planned
Closed as not planned
Copy link
Description
Some examples:
Lines 15 to 22 in ee88946
| Here's a trivial example: | |
| ```rust,no_run | |
| use assert_cmd::Command; | |
| let mut cmd = Command::cargo_bin("bin_fixture").unwrap(); | |
| cmd.assert().success(); | |
| ``` |
Lines 48 to 63 in ee88946
| //! And a little of everything: | |
| //! ```rust,no_run | |
| //! use assert_cmd::Command; | |
| //! | |
| //! let mut cmd = Command::cargo_bin("bin_fixture").unwrap(); | |
| //! let assert = cmd | |
| //! .arg("-A") | |
| //! .env("stdout", "hello") | |
| //! .env("exit", "42") | |
| //! .write_stdin("42") | |
| //! .assert(); | |
| //! assert | |
| //! .failure() | |
| //! .code(42) | |
| //! .stdout("hello\n"); | |
| //! ``` |
Lines 6 to 19 in ee88946
| //! # Examples | |
| //! | |
| //! Simple case: | |
| //! | |
| //! ```rust,no_run | |
| //! use assert_cmd::prelude::*; | |
| //! use assert_cmd::pkg_name; | |
| //! | |
| //! use std::process::Command; | |
| //! | |
| //! let mut cmd = Command::cargo_bin(pkg_name!()) | |
| //! .unwrap(); | |
| //! let output = cmd.unwrap(); | |
| //! ``` |
Perhaps beyond the scope of this issue, but I haven't been able to make use of the proposed alternatives to Command::cargo_bin:
https://github.com/oxidecomputer/oxide.rs/blob/06f4a01170f2decf81d4d39ca3a5f02a3c5345a6/cli/src/cmd_auth.rs#L651-L663
In particular, we're using this in a unit test which appears to be either something that worked by accident or a newly broken use case.
Metadata
Metadata
Assignees
Labels
No labels