From 04ad01390f68e7cc83de513e93fac18817801dbe Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Tue, 13 Jun 2017 23:40:50 -0700 Subject: Add test for a missing key --- tests/get.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/get.rs b/tests/get.rs index 1c98643..2df50a5 100644 --- a/tests/get.rs +++ b/tests/get.rs @@ -35,6 +35,17 @@ fn make() -> Config { c } +#[test] +fn test_not_found() { + let c = make(); + let res = c.get::("not_found"); + + assert!(res.is_err()); + assert_eq!(res.unwrap_err().to_string(), + "configuration property \"not_found\" not found" + .to_string()); +} + #[test] fn test_scalar() { let c = make(); -- cgit v1.2.3