diff --git a/src/config.rs b/src/config.rs index 5f8eb1b..bf8f532 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,6 +11,7 @@ pub struct Config { #[serde(default, deserialize_with = "deserialize_duration")] pub interval: Option, pub colors: Option, + #[serde(default)] pub checks: Vec, } @@ -182,6 +183,18 @@ mod tests { assert_eq!(config.interval, None); } + #[test] + fn test_should_parse_config_without_checks() { + let config: Config = toml::from_str( + r#" + interval = "2m 3s" + "#, + ) + .unwrap(); + + assert_eq!(config.checks.len(), 0); + } + #[test] fn test_should_parse_durations() { assert_eq!(parse_duration("1m30s"), Some(Duration::from_secs(90)));