aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/trust_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 17:59:57 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 18:59:14 +0000
commit795f896a5772d5e0795f86642bdf90c82efac45c (patch)
tree308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/ex_cmds/trust_spec.lua
parent4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff)
downloadrneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/ex_cmds/trust_spec.lua')
-rw-r--r--test/functional/ex_cmds/trust_spec.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/functional/ex_cmds/trust_spec.lua b/test/functional/ex_cmds/trust_spec.lua
index 953b25ba35..2997b504fa 100644
--- a/test/functional/ex_cmds/trust_spec.lua
+++ b/test/functional/ex_cmds/trust_spec.lua
@@ -7,7 +7,7 @@ local exec_capture = helpers.exec_capture
local matches = helpers.matches
local pathsep = helpers.get_pathsep()
local is_os = helpers.is_os
-local funcs = helpers.funcs
+local fn = helpers.fn
describe(':trust', function()
local xstate = 'Xstate'
@@ -30,53 +30,53 @@ describe(':trust', function()
end)
it('trust then deny then remove a file using current buffer', function()
- local cwd = funcs.getcwd()
- local hash = funcs.sha256(helpers.read_file('test_file'))
+ local cwd = fn.getcwd()
+ local hash = fn.sha256(helpers.read_file('test_file'))
command('edit test_file')
matches('^Allowed ".*test_file" in trust database%.$', exec_capture('trust'))
- local trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ local trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format('%s %s', hash, cwd .. pathsep .. 'test_file'), vim.trim(trust))
matches('^Denied ".*test_file" in trust database%.$', exec_capture('trust ++deny'))
- trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format('! %s', cwd .. pathsep .. 'test_file'), vim.trim(trust))
matches('^Removed ".*test_file" from trust database%.$', exec_capture('trust ++remove'))
- trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format(''), vim.trim(trust))
end)
it('deny then trust then remove a file using current buffer', function()
- local cwd = funcs.getcwd()
- local hash = funcs.sha256(helpers.read_file('test_file'))
+ local cwd = fn.getcwd()
+ local hash = fn.sha256(helpers.read_file('test_file'))
command('edit test_file')
matches('^Denied ".*test_file" in trust database%.$', exec_capture('trust ++deny'))
- local trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ local trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format('! %s', cwd .. pathsep .. 'test_file'), vim.trim(trust))
matches('^Allowed ".*test_file" in trust database%.$', exec_capture('trust'))
- trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format('%s %s', hash, cwd .. pathsep .. 'test_file'), vim.trim(trust))
matches('^Removed ".*test_file" from trust database%.$', exec_capture('trust ++remove'))
- trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format(''), vim.trim(trust))
end)
it('deny then remove a file using file path', function()
- local cwd = funcs.getcwd()
+ local cwd = fn.getcwd()
matches('^Denied ".*test_file" in trust database%.$', exec_capture('trust ++deny test_file'))
- local trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ local trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format('! %s', cwd .. pathsep .. 'test_file'), vim.trim(trust))
matches(
'^Removed ".*test_file" from trust database%.$',
exec_capture('trust ++remove test_file')
)
- trust = helpers.read_file(funcs.stdpath('state') .. pathsep .. 'trust')
+ trust = helpers.read_file(fn.stdpath('state') .. pathsep .. 'trust')
eq(string.format(''), vim.trim(trust))
end)
end)