File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Simplify running `bin`s in a Cargo project.
2
2
//!
3
- //! # Examples
3
+ //! `CommandCargoExt` is an extension trait for `std::process::Command` to easily launch a crate's
4
+ //! binaries.
5
+ //!
6
+ //! In addition, the underlying functions for looking up the crate's binaries are exposed to allow
7
+ //! for optimizations, if needed.
8
+ //!
9
+ //! # Simple Example
4
10
//!
5
11
//! ```rust
6
12
//! use assert_cmd::prelude::*;
11
17
//! .unwrap()
12
18
//! .unwrap();
13
19
//! ```
20
+ //!
21
+ //! # Caching Example
22
+ //!
23
+ //! ```rust
24
+ //! use assert_cmd::prelude::*;
25
+ //!
26
+ //! use std::process::Command;
27
+ //!
28
+ //! let bin_under_test = assert_cmd::cargo::main_binary_path().unwrap();
29
+ //! Command::new(&bin_under_test)
30
+ //! .unwrap();
31
+ //! ```
32
+ //!
33
+ //! Tip: Use [`lazy_static][lazy_static] to cache `bin_under_test` across test functions.
34
+ //!
35
+ //! [lazy_static]: https://crates.io/crates/lazy_static
14
36
15
37
use std:: error:: Error ;
16
38
use std:: ffi;
You can’t perform that action at this time.
0 commit comments