Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Use temp path for missing config test (#3530)

Isaac Sanchez-Hawkins444d0b1695c0
diff --git a/crates/screenpipe-config/src/persistence.rs b/crates/screenpipe-config/src/persistence.rs
index d8499e3c5..dade97113 100644
--- a/crates/screenpipe-config/src/persistence.rs
+++ b/crates/screenpipe-config/src/persistence.rs
@@ -51,12 +51,14 @@ fn dirs_next() -> Option<PathBuf> {
mod tests {
use super::*;
use std::io::Write;
- use tempfile::NamedTempFile;
+ use tempfile::{tempdir, NamedTempFile};
#[test]
fn load_missing_file_returns_default() {
- let path = Path::new("/tmp/screenpipe-test-nonexistent-config.toml");
- let settings = load_toml(path).unwrap();
+ let dir = tempdir().unwrap();
+ let path = dir.path().join("missing-config.toml");
+
+ let settings = load_toml(&path).unwrap();
assert_eq!(settings, RecordingSettings::default());
}