chore: add ignored_dirs test
parent
f886f9a2ec
commit
7f88f8a64c
|
|
@ -7,13 +7,13 @@ require("persisted").setup({
|
|||
allowed_dirs = { vim.fn.getcwd() },
|
||||
})
|
||||
|
||||
describe("With custom settings:", function()
|
||||
describe("Autoloading", function()
|
||||
|
||||
-- after_each(function()
|
||||
-- vim.fn.system("rm -rf " .. e(session_dir))
|
||||
-- end)
|
||||
|
||||
it("autoloads a file with allowed_dirs", function()
|
||||
it("autoloads a file with allowed_dirs config option present", function()
|
||||
local content = vim.fn.getline(1, '$')
|
||||
assert.equals(content[1], "If you're reading this, I guess auto-loading works")
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ require("persisted").setup({
|
|||
autosave = true,
|
||||
})
|
||||
|
||||
describe("With custom settings:", function()
|
||||
describe("Autoloading", function()
|
||||
|
||||
it("autoloads a file", function()
|
||||
local content = vim.fn.getline(1, '$')
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
local e = vim.fn.fnameescape
|
||||
local session_dir = vim.fn.getcwd() .. "/tests/dummy_data/"
|
||||
require("persisted").setup({
|
||||
dir = session_dir,
|
||||
autoload = true,
|
||||
ignored_dirs = { vim.fn.getcwd() },
|
||||
})
|
||||
|
||||
describe("Autoloading", function()
|
||||
|
||||
it("is stopped if an ignored dir is present", function()
|
||||
local content = vim.fn.getline(1, '$')
|
||||
assert.equals(content[1], "")
|
||||
end)
|
||||
|
||||
end)
|
||||
Loading…
Reference in New Issue