use std::path::PathBuf;
use kimun_notes::settings::AppSettings;
#[test]
fn a_bare_config_filename_loads_from_the_working_directory() {
let dir = tempfile::TempDir::new().unwrap();
let original = std::env::current_dir().unwrap();
std::env::set_current_dir(dir.path()).unwrap();
let loaded = AppSettings::load_from_file(PathBuf::from("kimun.toml"));
std::env::set_current_dir(&original).unwrap();
loaded.expect("a bare --config filename must load rather than abort");
assert!(
dir.path().join("kimun.toml").exists(),
"the default config should have been written beside the working directory"
);
}