From 9a2e756075dce24e764c8c89e2d71703a69fd80a Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Tue, 13 Jun 2017 23:43:35 -0700 Subject: Add (failing) test for File::with_name --- tests/file.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/file.rs') diff --git a/tests/file.rs b/tests/file.rs index a1b7506..4dba71f 100644 --- a/tests/file.rs +++ b/tests/file.rs @@ -20,3 +20,12 @@ fn test_file_required_not_found() { "configuration file \"tests/NoSettings\" not found" .to_string()); } + +#[test] +fn test_file_auto() { + let mut c = Config::default(); + c.merge(File::with_name("tests/Settings-production")).unwrap(); + + assert_eq!(c.get("debug").ok(), Some(false)); + assert_eq!(c.get("production").ok(), Some(true)); +} -- cgit v1.2.3