diff --git a/tests/integration.rs b/tests/integration.rs index 774fab3..8c5c202 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -9,8 +9,18 @@ fn sandbox(extra_args: &[&str]) -> Command { cmd } +struct CleanupFile(&'static str); + +impl Drop for CleanupFile { + fn drop(&mut self) { + let _ = fs::remove_file(self.0); + } +} + #[test] fn cwd_is_writable() { + let _cleanup = CleanupFile("./sandbox_canary"); + let output = sandbox(&[]) .args(["--", "bash", "-c", "touch ./sandbox_canary && echo ok"]) .output()