Keep tests out of the user's real config by giving them a temp home
Co-Authored-By: Claude Opus 5.5
@@ -1,6 +1,9 @@
11 use std::path::{Path, PathBuf};
22
33 pub fn home() -> PathBuf {
4+ if cfg!(test) {
5+ return std::env::temp_dir().join("cast-test-home");
6+ }
47 PathBuf::from(std::env::var_os("HOME").unwrap_or_default())
58 }