mirror of https://github.com/folke/lazy.nvim.git
test: test XDG paths for tests and added a test that checks if they are setup correctly
This commit is contained in:
parent
d46bc7795c
commit
ac9e5401dc
|
@ -0,0 +1,7 @@
|
|||
describe("init", function()
|
||||
it("has correct environment for tests", function()
|
||||
for _, path in ipairs({ "config", "data", "cache", "state" }) do
|
||||
assert(vim.fn.stdpath(path):find(".tests/" .. path))
|
||||
end
|
||||
end)
|
||||
end)
|
|
@ -27,6 +27,10 @@ function M.setup()
|
|||
vim.opt.runtimepath:append(M.root())
|
||||
vim.opt.packpath = { M.root(".tests/site") }
|
||||
M.load("nvim-lua/plenary.nvim")
|
||||
vim.env.XDG_CONFIG_HOME = M.root(".tests/config")
|
||||
vim.env.XDG_DATA_HOME = M.root(".tests/data")
|
||||
vim.env.XDG_STATE_HOME = M.root(".tests/state")
|
||||
vim.env.XDG_CACHE_HOME = M.root(".tests/cache")
|
||||
end
|
||||
|
||||
M.setup()
|
||||
|
|
Loading…
Reference in New Issue