summaryrefslogtreecommitdiffstats
path: root/tests/get_scalar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/get_scalar.rs')
-rw-r--r--tests/get_scalar.rs52
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/get_scalar.rs b/tests/get_scalar.rs
deleted file mode 100644
index 5d54e18..0000000
--- a/tests/get_scalar.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-extern crate config;
-
-use config::*;
-
-fn make() -> Config {
- let mut c = Config::default();
- c.merge(File::new("tests/Settings", FileFormat::Toml))
- .unwrap();
-
- c
-}
-
-#[test]
-fn test_scalar() {
- let c = make();
-
- assert_eq!(c.get("debug").ok(), Some(true));
- assert_eq!(c.get("production").ok(), Some(false));
-}
-
-#[test]
-fn test_scalar_type_loose() {
- let c = make();
-
- assert_eq!(c.get("debug").ok(), Some(true));
- assert_eq!(c.get("debug").ok(), Some("true".to_string()));
- assert_eq!(c.get("debug").ok(), Some(1));
- assert_eq!(c.get("debug").ok(), Some(1.0));
-
- assert_eq!(c.get("debug_s").ok(), Some(true));
- assert_eq!(c.get("debug_s").ok(), Some("true".to_string()));
- assert_eq!(c.get("debug_s").ok(), Some(1));
- assert_eq!(c.get("debug_s").ok(), Some(1.0));
-
- assert_eq!(c.get("production").ok(), Some(false));
- assert_eq!(c.get("production").ok(), Some("false".to_string()));
- assert_eq!(c.get("production").ok(), Some(0));
- assert_eq!(c.get("production").ok(), Some(0.0));
-
- assert_eq!(c.get("production_s").ok(), Some(false));
- assert_eq!(c.get("production_s").ok(), Some("false".to_string()));
- assert_eq!(c.get("production_s").ok(), Some(0));
- assert_eq!(c.get("production_s").ok(), Some(0.0));
-}
-
-#[test]
-fn test_get_scalar_path() {
- let c = make();
-
- assert_eq!(c.get("place.favorite").ok(), Some(false));
- assert_eq!(c.get("place.creator.name").ok(), Some("John Smith".to_string()));
-}