From c9f56ea275dae1c056e52d8dd3ce9849c7a5dacd Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 13 Sep 2025 20:28:58 +0200 Subject: [PATCH] tests/plugins/project-nvim: set datapath to a writable directory --- .../plugins/by-name/project-nvim/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test-sources/plugins/by-name/project-nvim/default.nix b/tests/test-sources/plugins/by-name/project-nvim/default.nix index 4a3cb4df..e6a4870f 100644 --- a/tests/test-sources/plugins/by-name/project-nvim/default.nix +++ b/tests/test-sources/plugins/by-name/project-nvim/default.nix @@ -1,6 +1,11 @@ { empty = { - plugins.project-nvim.enable = true; + plugins.project-nvim = { + enable = true; + + # The default datapath is unwritable in the sandbox + settings.datapath.__raw = "os.getenv('TMPDIR')"; + }; }; telescopeEnabled = { @@ -10,11 +15,18 @@ plugins.project-nvim = { enable = true; enableTelescope = true; + + # The default datapath is unwritable in the sandbox + settings.datapath.__raw = "os.getenv('TMPDIR')"; }; plugins.web-devicons.enable = true; }; defaults = { + # Attempts at writing to `datapath`: + # ERROR: Invalid `datapath`, reverting to default. + test.runNvim = false; + plugins.project-nvim = { enable = true; settings = { @@ -37,7 +49,7 @@ show_hidden = false; silent_chdir = true; scope_chdir = "global"; - data_path.__raw = "vim.fn.stdpath('data')"; + datapath.__raw = "vim.fn.stdpath('data')"; }; }; };