mirror of
https://github.com/zoriya/lz.n.git
synced 2026-05-27 08:34:36 +00:00
701d6acc03
* feat!: simplify state management + idempotent `trigger_load(name)` * feat!: `lz.n.Handler.del` now takes a plugin name (`string`)
22 lines
641 B
Lua
22 lines
641 B
Lua
vim.g.lz_n = {
|
|
load = function() end,
|
|
}
|
|
local colorscheme = require("lz.n.handler.colorscheme")
|
|
local loader = require("lz.n.loader")
|
|
local spy = require("luassert.spy")
|
|
|
|
describe("handlers.colorscheme", function()
|
|
it("Colorscheme only loads plugin once", function()
|
|
---@type lz.n.Plugin
|
|
local plugin = {
|
|
name = "sweetie.nvim",
|
|
colorscheme = { "sweetie" },
|
|
}
|
|
local spy_load = spy.on(loader, "_load")
|
|
colorscheme.add(plugin)
|
|
pcall(vim.cmd.colorscheme, "sweetie")
|
|
pcall(vim.cmd.colorscheme, "sweetie")
|
|
assert.spy(spy_load).called(1)
|
|
end)
|
|
end)
|