test: fix dependencies between test cases

Discovered using --shuffle argument of busted.

(cherry picked from commit f273a5a529)
This commit is contained in:
zeertzjq
2023-04-27 12:11:20 +08:00
committed by github-actions[bot]
parent 5c26f463bb
commit 1d9ef90115
9 changed files with 49 additions and 36 deletions

View File

@@ -19,21 +19,14 @@ describe('vim.secure', function()
local xstate = 'Xstate'
setup(function()
clear{env={XDG_STATE_HOME=xstate}}
helpers.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim'))
end)
teardown(function()
helpers.rmdir(xstate)
end)
before_each(function()
helpers.write_file('Xfile', [[
let g:foobar = 42
]])
clear{env={XDG_STATE_HOME=xstate}}
end)
after_each(function()
teardown(function()
os.remove('Xfile')
helpers.rmdir(xstate)
end)
@@ -175,6 +168,7 @@ describe('vim.secure', function()
local xstate = 'Xstate'
setup(function()
clear{env={XDG_STATE_HOME=xstate}}
helpers.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim'))
end)