Use Default Configuration for Tests
Uses the default configuration for tests,
in order to not mess up test cases with
different configurations in the config file.
@@ -79,6 +79,7 @@ impl Config {
}
/// Entry point of the configuration
+ #[cfg(not(test))]
pub fn from_cli_config(cli_config: Option<ConfigCli>) -> ConfigResult {
match cli_config {
Some(ConfigCli::Config { clean, .. }) if clean => Ok(Config::default()),
@@ -88,6 +89,13 @@ impl Config {
Some(_) | None => Ok(Config::from_default_path()?),
}
}
+
+ //#[allow(unused_must_use)]
+ /// In order not to mess up tests from changing configurations
+ #[cfg(test)]
+ pub fn from_cli_config(_: Option<ConfigCli>) -> ConfigResult {
+ Ok(Config::default())
+ }
}
impl Display for ConfigError {
