diff options
author | kylo252 <[email protected]> | 2022-04-20 13:22:26 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-20 13:22:26 +0200 |
commit | 0481ec8dddf4bd8ed81c10ae98807fec97f6f872 (patch) | |
tree | 10a85cd7266f288a9b49e9658a377413854622ba /tests/specs/bootstrap_spec.lua | |
parent | 3d841425aed288091068bbb8d15376c9908c6cec (diff) |
refactor: update impatient (#2477)
Diffstat (limited to 'tests/specs/bootstrap_spec.lua')
-rw-r--r-- | tests/specs/bootstrap_spec.lua | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/specs/bootstrap_spec.lua b/tests/specs/bootstrap_spec.lua index 94dd31b1..51c3330e 100644 --- a/tests/specs/bootstrap_spec.lua +++ b/tests/specs/bootstrap_spec.lua @@ -1,19 +1,26 @@ local a = require "plenary.async_lib.tests" +local uv = vim.loop +local home_dir = uv.os_homedir() a.describe("initial start", function() - local uv = vim.loop - local home_dir = uv.os_homedir() - local lvim_config_path = get_config_dir() or home_dir .. "/.config/lvim" - local lvim_runtime_path = get_runtime_dir() or home_dir .. "/.local/share/lunarvim" + local lvim_config_path = get_config_dir() + local lvim_runtime_path = get_runtime_dir() + local lvim_cache_path = get_cache_dir() a.it("should be able to detect test environment", function() assert.truthy(os.getenv "LVIM_TEST_ENV") assert.falsy(package.loaded["lvim.impatient"]) end) - a.it("should not be reading default neovim directories in the home directories", function() - local rtp_list = vim.opt.rtp:get() - assert.falsy(vim.tbl_contains(rtp_list, vim.fn.stdpath "config")) + a.it("should be able to use lunarvim directories using vim.fn", function() + assert.equal(lvim_runtime_path, vim.fn.stdpath "data") + assert.equal(lvim_config_path, vim.fn.stdpath "config") + assert.equal(lvim_cache_path, vim.fn.stdpath "cache") + end) + + a.it("should be to retrieve default neovim directories", function() + local xdg_config = os.getenv "XDG_CONFIG_HOME" or join_paths(home_dir, ".config") + assert.equal(join_paths(xdg_config, "nvim"), vim.call("stdpath", "config")) end) a.it("should be able to read lunarvim directories", function() |