summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2018-09-25 23:58:34 -0700
committerRyan Leckey <ryan@launchbadge.com>2018-09-25 23:58:34 -0700
commit1612293b617f5459d2313c776d5117401c6aa8c2 (patch)
treeb749a835b8f3d380b86adc26a2047046bdda645d /tests
parent2e8f12f0e76818a650749a6311f5a79a70be49b0 (diff)
Fix #75; tests run with --no-default-features
Diffstat (limited to 'tests')
-rw-r--r--tests/datetime.rs8
-rw-r--r--tests/errors.rs2
-rw-r--r--tests/file.rs2
-rw-r--r--tests/file_hjson.rs2
-rw-r--r--tests/file_ini.rs2
-rw-r--r--tests/file_json.rs2
-rw-r--r--tests/file_toml.rs2
-rw-r--r--tests/file_yaml.rs2
-rw-r--r--tests/get.rs2
-rw-r--r--tests/merge.rs2
-rw-r--r--tests/set.rs4
11 files changed, 30 insertions, 0 deletions
diff --git a/tests/datetime.rs b/tests/datetime.rs
index f318f03..6c1e620 100644
--- a/tests/datetime.rs
+++ b/tests/datetime.rs
@@ -1,3 +1,11 @@
+#![cfg(all(
+ feature = "toml",
+ feature = "json",
+ feature = "hjson",
+ feature = "yaml",
+ feature = "ini",
+))]
+
extern crate chrono;
extern crate config;
diff --git a/tests/errors.rs b/tests/errors.rs
index 77a58ab..6bc674f 100644
--- a/tests/errors.rs
+++ b/tests/errors.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "toml")]
+
extern crate config;
use config::*;
diff --git a/tests/file.rs b/tests/file.rs
index c89d5da..0680c2a 100644
--- a/tests/file.rs
+++ b/tests/file.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "yaml")]
+
extern crate config;
use config::*;
diff --git a/tests/file_hjson.rs b/tests/file_hjson.rs
index 40c25cb..9c63ad6 100644
--- a/tests/file_hjson.rs
+++ b/tests/file_hjson.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "hjson")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/file_ini.rs b/tests/file_ini.rs
index 30d86a3..833cab0 100644
--- a/tests/file_ini.rs
+++ b/tests/file_ini.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "ini")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/file_json.rs b/tests/file_json.rs
index c07a77d..4b586b2 100644
--- a/tests/file_json.rs
+++ b/tests/file_json.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "json")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/file_toml.rs b/tests/file_toml.rs
index b1e70c0..0b5db4f 100644
--- a/tests/file_toml.rs
+++ b/tests/file_toml.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "toml")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/file_yaml.rs b/tests/file_yaml.rs
index 1d00d85..85788c4 100644
--- a/tests/file_yaml.rs
+++ b/tests/file_yaml.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "yaml")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/get.rs b/tests/get.rs
index 87f80a1..73eeeaf 100644
--- a/tests/get.rs
+++ b/tests/get.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "toml")]
+
extern crate config;
extern crate float_cmp;
extern crate serde;
diff --git a/tests/merge.rs b/tests/merge.rs
index d6eb9e0..1be7db1 100644
--- a/tests/merge.rs
+++ b/tests/merge.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "toml")]
+
extern crate config;
use config::*;
diff --git a/tests/set.rs b/tests/set.rs
index e1f6290..bd439a0 100644
--- a/tests/set.rs
+++ b/tests/set.rs
@@ -11,6 +11,7 @@ fn test_set_scalar() {
assert_eq!(c.get("value").ok(), Some(true));
}
+#[cfg(feature = "toml")]
#[test]
fn test_set_scalar_default() {
let mut c = Config::default();
@@ -25,6 +26,7 @@ fn test_set_scalar_default() {
assert_eq!(c.get("staging").ok(), Some(false));
}
+#[cfg(feature = "toml")]
#[test]
fn test_set_scalar_path() {
let mut c = Config::default();
@@ -43,6 +45,7 @@ fn test_set_scalar_path() {
assert_eq!(c.get("place.blocked").ok(), Some(true));
}
+#[cfg(feature = "toml")]
#[test]
fn test_set_arr_path() {
let mut c = Config::default();
@@ -74,6 +77,7 @@ fn test_set_arr_path() {
assert_eq!(c.get("items[2]").ok(), Some("George".to_string()));
}
+#[cfg(feature = "toml")]
#[test]
fn test_set_capital() {
let mut c = Config::default();