diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-03-08 13:25:34 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-08 13:25:34 +0100 |
| commit | a1cf6872869147ec43d4568b54bc9d7be676382b (patch) | |
| tree | 8791e385ecbfb863eea949fc617c1eee0a99564b | |
| parent | 7dbde214f88948eba577130db1bfa0fe12e28820 (diff) | |
| download | mullvadvpn-a1cf6872869147ec43d4568b54bc9d7be676382b.tar.xz mullvadvpn-a1cf6872869147ec43d4568b54bc9d7be676382b.zip | |
Add stop-test on ChildMonitor
| -rw-r--r-- | src/process/monitor.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/process/monitor.rs b/src/process/monitor.rs index 8caac5cc79..83390b7a34 100644 --- a/src/process/monitor.rs +++ b/src/process/monitor.rs @@ -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, _))); + } } |
