From 46a038dc68093b28b69c3af38de4dd09431efae2 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 9 Oct 2022 20:08:36 +0300 Subject: [PATCH] conf.rs: remove interactive messages when #[cfg(test)] --- src/conf.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf.rs b/src/conf.rs index dcf88e465..fdd455629 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -345,18 +345,22 @@ impl FileSettings { if path_string.is_empty() { return Err(MeliError::new("No configuration found.")); } + #[cfg(not(test))] let ask = Ask { message: format!( "No configuration found. Would you like to generate one in {}?", path_string ), }; + #[cfg(not(test))] if ask.run() { create_config_file(&config_path)?; return Err(MeliError::new( "Edit the sample configuration and relaunch meli.", )); } + #[cfg(test)] + return Ok(FileSettings::default()); return Err(MeliError::new("No configuration file found.")); }