chore: update tests

main
olimorris 2022-04-04 23:22:23 +01:00
parent 9c3cc1ff59
commit 45d944c8ec
2 changed files with 6 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
plenary.nvim/ plenary.nvim/
tests/data/ tests/default_data/
tests/custom_data/
.luarc.json .luarc.json

View File

@ -1,4 +1,4 @@
local session_dir = vim.fn.getcwd() .. "/tests/data/" local session_dir = vim.fn.getcwd() .. "/tests/default_data/"
require("persisted").setup({ require("persisted").setup({
dir = session_dir dir = session_dir
}) })
@ -10,7 +10,7 @@ describe("With default settings:", function()
it("saves a session", function() it("saves a session", function()
-- Check no file exists -- Check no file exists
assert.equals(vim.fn.system("ls tests/data | wc -l"), "0\n") assert.equals(vim.fn.system("ls tests/default_data | wc -l"), "0\n")
-- Edit a buffer -- Edit a buffer
vim.cmd(":e tests/stubs/test.txt") vim.cmd(":e tests/stubs/test.txt")
@ -21,7 +21,7 @@ describe("With default settings:", function()
-- Check that the session is written to disk -- Check that the session is written to disk
assert.equals(vim.g.persisting, true) assert.equals(vim.g.persisting, true)
assert.equals(vim.fn.system("ls tests/data | wc -l"), "1\n") assert.equals(vim.fn.system("ls tests/default_data | wc -l"), "1\n")
end) end)
it("loads a session", function() it("loads a session", function()
@ -57,7 +57,7 @@ describe("With default settings:", function()
it("deletes a session", function() it("deletes a session", function()
require("persisted").delete() require("persisted").delete()
assert.equals(vim.fn.system("ls tests/data | wc -l"), "0\n") assert.equals(vim.fn.system("ls tests/default_data | wc -l"), "0\n")
end) end)
end) end)