diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2021-03-17 22:50:03 +0100 |
|---|---|---|
| committer | a-kenji <aks.kenji@protonmail.com> | 2021-03-17 22:50:03 +0100 |
| commit | 91c109a90245edb3791cd3234787a8a1f6a8f794 (patch) | |
| tree | 19a6c86f3175dd4651fad026df07c004822ad1b3 /src/common/input/config.rs | |
| parent | Add a clean config option (diff) | |
| download | sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.gz sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.xz sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.zip | |
Move test to /unit
Diffstat (limited to 'src/common/input/config.rs')
| -rw-r--r-- | src/common/input/config.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/common/input/config.rs b/src/common/input/config.rs index 668b4106..7d804d68 100644 --- a/src/common/input/config.rs +++ b/src/common/input/config.rs @@ -122,5 +122,21 @@ impl From<serde_yaml::Error> for ConfigError { // The unit test location. #[cfg(test)] -#[path = "./ut/config_test.rs"] -mod config_test; +mod config_test { + use super::*; + + #[test] + fn no_config_file_equals_default_config() { + let no_file = PathBuf::from(r"../fixtures/config/config.yamlll"); + let config = Config::from_option_or_default(Some(no_file)).unwrap(); + let default = Config::default(); + assert_eq!(config, default); + } + + #[test] + fn no_config_option_file_equals_default_config() { + let config = Config::from_option_or_default(None).unwrap(); + let default = Config::default(); + assert_eq!(config, default); + } +} |
