This repository was archived by the owner on Dec 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,4 +16,4 @@ dev = ["clippy"]
1616[dependencies ]
1717ansi_term = " 0.6.3"
1818difference = " 0.4.0"
19- clippy = {version = " 0.0.21 " , optional = true }
19+ clippy = {version = " 0.0.23 " , optional = true }
Original file line number Diff line number Diff line change 2828//!
2929//! Alternatively, you can use the `assert_cli!` macro:
3030//!
31- //! ```rust,ignore
32- //! assert_cli!("echo 42" => Success, "42").unwrap();
31+ //! ```rust
32+ //! # #[macro_use] extern crate assert_cli;
33+ //! # fn main() {
34+ //! assert_cli!("echo", &["42"] => Success, "42").unwrap();
35+ //! # }
3336//! ```
3437//!
3538//! Make sure to include the crate as `#[macro_use] extern crate assert_cli;`.
@@ -161,9 +164,15 @@ pub fn assert_cli_output_error<S>(cmd: &str,
161164/// The `assert_cli!` macro combines the functionality of the other functions in this crate in one
162165/// short macro.
163166///
164- /// ```rust,ignore
165- /// assert_cli!("echo 42" => Success, "42").unwrap();
166- /// assert_cli!("exit 11" => Error 11, "").unwrap();
167+ /// ```rust
168+ /// #[macro_use] extern crate assert_cli;
169+ /// # const BLACK_BOX: &'static str = r#"function test_helper() {\
170+ /// # >&2 echo "error no 66!"; return 66; }; test_helper"#;
171+ ///
172+ /// fn main() {
173+ /// assert_cli!("echo", &["42"] => Success, "42").unwrap();
174+ /// assert_cli!("bash", &["-c", BLACK_BOX] => Error 66, "error no 66!").unwrap();
175+ /// }
167176/// ```
168177///
169178/// Make sure to include the crate as `#[macro_use] extern crate assert_cli;`.
You can’t perform that action at this time.
0 commit comments