chore: initial project setup
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[submodule ".tests/vendor/plenary.nvim"]
|
||||
path = .tests/vendor/plenary.nvim
|
||||
url = https://github.com/nvim-lua/plenary.nvim
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compiler": {
|
||||
"verbosity": "Information"
|
||||
},
|
||||
"workspace": {
|
||||
"library": [
|
||||
"$VIMRUNTIME/lua",
|
||||
"${3rd}/luv/library",
|
||||
"./.tests/vendor/plenary.nvim"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+1
Submodule .tests/vendor/plenary.nvim added at 74b06c6c75
+19
@@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2026 Stevan Freeborn
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,3 @@
|
||||
# watchexec.nvim
|
||||
|
||||
This plugin allows you to start and stop a task using watchexec and display the output of the task within Neovim.
|
||||
@@ -0,0 +1,15 @@
|
||||
local M = {}
|
||||
|
||||
M.config = {
|
||||
greeting = "Hello from my plugin"
|
||||
}
|
||||
|
||||
function M.setup(opts)
|
||||
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
|
||||
end
|
||||
|
||||
function M.say_hello()
|
||||
print(M.config.greeting)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,9 @@
|
||||
if vim.g.loaded_watchexec then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.loaded_watchexec = 1
|
||||
|
||||
vim.api.nvim_create_user_command("SayHello", function()
|
||||
require("watchexec").say_hello()
|
||||
end, {})
|
||||
@@ -0,0 +1 @@
|
||||
nvim --headless -c "PlenaryBustedDirectory tests/watchexec/ {minimal_init = 'tests/minimal_init.lua'}"
|
||||
@@ -0,0 +1,3 @@
|
||||
vim.opt.runtimepath:append(".")
|
||||
vim.opt.runtimepath:append(".tests/vendor/plenary.nvim")
|
||||
print("Minimal init loaded successfully!")
|
||||
@@ -0,0 +1,17 @@
|
||||
local plugin = require("watchexec")
|
||||
|
||||
describe("watchexec logic", function()
|
||||
before_each(function()
|
||||
plugin.setup({
|
||||
greeting = "Hello Test!"
|
||||
})
|
||||
end)
|
||||
|
||||
it("can be required without errors", function()
|
||||
assert.not_nil(plugin)
|
||||
end)
|
||||
|
||||
it("correctly applies user configuration", function()
|
||||
assert.equals("Hello Test!", plugin.config.greeting)
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user