Last active
November 5, 2015 08:17
-
-
Save timonv/8e2a395cc1f2f68ca2ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process::{Command, Child}; | |
pub fn run() -> Result<Child> { | |
let child = try!(Command::new("echo").arg("world").spawn()); | |
Ok(child) | |
} | |
#[cfg(test)] | |
mod test { | |
use super::*; | |
#[test] | |
fn test_simple_command() { | |
let child = run().unwrap().wait_with_output().unwrap(); | |
let result = String::from_utf8(child.stdout).unwrap(); | |
assert_eq!(result, "world"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment