mockcmd 0.0.1

A mockable std::process::Command
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(not(feature = "test"))]
mod tests {
    use mockcmd::Command;

    #[test]
    fn using_non_test_code() {
        let mut cmd = Command::new("echo");
        cmd.arg("hello");
        let output = cmd.output().unwrap();
        assert!(output.status.success());
        assert_eq!(output.stdout, b"hello\n");
    }
}