diff options
Diffstat (limited to 'test/functional/lua/secure_spec.lua')
-rw-r--r-- | test/functional/lua/secure_spec.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/lua/secure_spec.lua b/test/functional/lua/secure_spec.lua index 46ca2bba8f..6885253998 100644 --- a/test/functional/lua/secure_spec.lua +++ b/test/functional/lua/secure_spec.lua @@ -12,6 +12,7 @@ local feed_command = helpers.feed_command local feed = helpers.feed local funcs = helpers.funcs local pcall_err = helpers.pcall_err +local matches = helpers.matches describe('vim.secure', function() describe('read()', function() @@ -189,10 +190,15 @@ describe('vim.secure', function() end) it('returns error when passing both path and bufnr', function() - eq('path and bufnr are mutually exclusive', + matches('"path" and "bufnr" are mutually exclusive', pcall_err(exec_lua, [[vim.secure.trust({action='deny', bufnr=0, path='test_file'})]])) end) + it('returns error when passing neither path or bufnr', function() + matches('one of "path" or "bufnr" is required', + pcall_err(exec_lua, [[vim.secure.trust({action='deny'})]])) + end) + it('trust then deny then remove a file using bufnr', function() local cwd = funcs.getcwd() local hash = funcs.sha256(helpers.read_file('test_file')) |