From 96501931d4f5296661a92384262f7249d8ea7438 Mon Sep 17 00:00:00 2001 From: Robert Hill Date: Thu, 10 Sep 2026 22:08:00 -0400 Subject: [PATCH] test: keep the exit-hook specs off the real mount directory setup() sweeps the configured base dir, so these specs unmounted whatever sat in the developer's ~/mnt. With every tool stubbed as present that meant spawning diskutil on Linux, and the suite passed or failed by machine. --- tests/unmount_spec.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unmount_spec.lua b/tests/unmount_spec.lua index a077439..f540593 100644 --- a/tests/unmount_spec.lua +++ b/tests/unmount_spec.lua @@ -118,9 +118,17 @@ describe("automatic unmount on exit", function() stub.set("fn.executable", function() return 1 end) + -- setup() sweeps the mount base dir, so keep it off the developer's real one. + stub.set("system", function() + return { + wait = function() + return { code = 0, stdout = "", stderr = "" } + end, + } + end) stub.notifications() - require("sshfs").setup({ hooks = hooks }) + require("sshfs").setup({ hooks = hooks, mounts = { base_dir = vim.fn.tempname() } }) stub.restore_all() return events