mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-22 22:26:54 +03:00
Merge pull request #436 from a-kenji/fix-default-config-test
Enables the Default Config Test
This commit is contained in:
commit
bf6386f495
@ -199,12 +199,10 @@ mod config_test {
|
||||
assert_eq!(result.unwrap(), Config::default());
|
||||
}
|
||||
|
||||
// This test needs a split somewhere between test and normal runs,
|
||||
// since otherwise it would look in a local configuration and fail.
|
||||
//#[test]
|
||||
//fn try_from_cli_args_default() {
|
||||
//let opts = CliArgs::default();
|
||||
//let result = Config::try_from(&opts);
|
||||
//assert_eq!(result.unwrap(), Config::default());
|
||||
//}
|
||||
#[test]
|
||||
fn try_from_cli_args_default() {
|
||||
let opts = CliArgs::default();
|
||||
let result = Config::try_from(&opts);
|
||||
assert_eq!(result.unwrap(), Config::default());
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ pub mod install {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
pub fn find_default_config_dir() -> Option<PathBuf> {
|
||||
vec![
|
||||
Some(xdg_config_dir()),
|
||||
@ -60,6 +61,11 @@ pub fn find_default_config_dir() -> Option<PathBuf> {
|
||||
.flatten()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn find_default_config_dir() -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn xdg_config_dir() -> PathBuf {
|
||||
let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
|
||||
project_dirs.config_dir().to_owned()
|
||||
|
Loading…
Reference in New Issue
Block a user