summaryrefslogtreecommitdiff
path: root/tests/specs/config_loader_spec.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-04-12 11:18:17 +0200
committerGitHub <[email protected]>2022-04-12 11:18:17 +0200
commit1569202d39c40d7a44de5eb1b10cf203dd33af41 (patch)
treef44862786fe8d39e5f7cd2ec7d0c101b27bc68ba /tests/specs/config_loader_spec.lua
parent3de6a404c92e495baa8688aa76d98c4ea9caa8c7 (diff)
fix(impatient): avoid get_options in fast handler (#2451)
Diffstat (limited to 'tests/specs/config_loader_spec.lua')
-rw-r--r--tests/specs/config_loader_spec.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/specs/config_loader_spec.lua b/tests/specs/config_loader_spec.lua
index 1f2debc7..40eaa350 100644
--- a/tests/specs/config_loader_spec.lua
+++ b/tests/specs/config_loader_spec.lua
@@ -4,16 +4,28 @@ local config = require "lvim.config"
a.describe("config-loader", function()
local user_config_path = config:get_user_config_path()
+ before_each(function()
+ vim.cmd [[
+ let v:errmsg = ""
+ let v:errors = []
+ ]]
+ end)
+
+ after_each(function()
+ local errmsg = vim.fn.eval "v:errmsg"
+ local exception = vim.fn.eval "v:exception"
+ local errors = vim.fn.eval "v:errors"
+ assert.equal("", errmsg)
+ assert.equal("", exception)
+ assert.True(vim.tbl_isempty(errors))
+ end)
+
a.it("should be able to find user-config", function()
assert.equal(user_config_path, get_config_dir() .. "/config.lua")
end)
a.it("should be able to load user-config without errors", function()
config:load(user_config_path)
- local errmsg = vim.fn.eval "v:errmsg"
- local exception = vim.fn.eval "v:exception"
- assert.equal("", errmsg) -- v:errmsg was not updated.
- assert.equal("", exception)
end)
a.it("should be able to reload user-config without errors", function()