diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-03-10 10:30:04 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-10 10:30:04 +0100 |
| commit | f4424ce56f5b08aa9ccbaa6d2d9660244164345c (patch) | |
| tree | 6822ae4f23e00fd0635bcb899d4aeda078e409a9 /src/process/monitor.rs | |
| parent | f2cc9fddc38eb7e3c75b2dccff8f135d30425c4d (diff) | |
| parent | 2452184f6c68b8c43d4a3d061a34485942af4685 (diff) | |
| download | mullvadvpn-f4424ce56f5b08aa9ccbaa6d2d9660244164345c.tar.xz mullvadvpn-f4424ce56f5b08aa9ccbaa6d2d9660244164345c.zip | |
Merge branch 'add-tests'
Diffstat (limited to 'src/process/monitor.rs')
| -rw-r--r-- | src/process/monitor.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/process/monitor.rs b/src/process/monitor.rs index 8caac5cc79..070cbdf196 100644 --- a/src/process/monitor.rs +++ b/src/process/monitor.rs @@ -140,7 +140,7 @@ impl<S: ChildSpawner> Drop for ChildMonitor<S> { #[cfg(test)] -mod child_monitor { +mod child_monitor_tests { use super::*; use std::io; use std::process::{ChildStdout, ChildStderr}; @@ -256,4 +256,12 @@ mod child_monitor { assert!(testee.stop().is_ok()); assert_event!(rx, Ok(true)); } + + #[test] + fn stop_without_start() { + let spawner = MockChildSpawner::new(Some(MockChild::alive_until_kill())); + let testee = ChildMonitor::new(spawner); + + assert_matches!(testee.stop(), Err(Error(ErrorKind::InvalidState, _))); + } } |
