//! This crate provide some helper functions to capture the stdin/out/err of the current process to help mocking.
//!
//! In testing, `cargo test` capture the stdout/err via `std::io::set_output_capture`. We can use the same mechanism to intercept [print!] and [eprint!] output. The crate wraps the call in [OutputCapture] so that you can intercept the output easily.
//!
//! The crate also implements a `pipe`-then-`dup` method to intercept stdio. In detail, it creates a pipe and replaces the fd of stdio. You can use [PipedStdin] to intercept stdin, use [PipedStdout] for stdout and [PipedStderr] for stderr.
use Error;
pub use *;
pub use *;
/// Common trait to capture stdio and then restore
///
/// You should use [Capture::capture] to begin intercept and restore it via [Capture::restore] or [Drop].