xonecas.ioDon't click! Sean Caetano Martin Sign in

cast / commits / 0af9329

Keep tests out of the user's real config by giving them a temp home

Co-Authored-By: Claude Opus 5.5

sacenox8 days ago0af9329bd9bc0d9f7c8f8c929bb0363eab24c8d2parent 0f08cf81 file changed

src/paths.rs+3-0
@@ -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 }