aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGiuseppe Gadola <67549788+giusgad@users.noreply.github.com>2023-01-28 14:34:42 +0100
committerGitHub <noreply@github.com>2023-01-28 14:34:42 +0100
commit1c414d807e36af4520912c88f9b8ef93467dce38 (patch)
tree22ab604e3824624018c43e28b57b7e8768b7d910 /tests
Initial commit
Diffstat (limited to 'tests')
-rw-r--r--tests/minimal_init.lua11
-rw-r--r--tests/plugin_name/plugin_name_spec.lua12
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/minimal_init.lua b/tests/minimal_init.lua
new file mode 100644
index 0000000..0841a82
--- /dev/null
+++ b/tests/minimal_init.lua
@@ -0,0 +1,11 @@
+local plenary_dir = os.getenv("PLENARY_DIR") or "/tmp/plenary.nvim"
+local is_not_a_directory = vim.fn.isdirectory(plenary_dir) == 0
+if is_not_a_directory then
+ vim.fn.system({"git", "clone", "https://github.com/nvim-lua/plenary.nvim", plenary_dir})
+end
+
+vim.opt.rtp:append(".")
+vim.opt.rtp:append(plenary_dir)
+
+vim.cmd("runtime plugin/plenary.vim")
+require("plenary.busted")
diff --git a/tests/plugin_name/plugin_name_spec.lua b/tests/plugin_name/plugin_name_spec.lua
new file mode 100644
index 0000000..42ab112
--- /dev/null
+++ b/tests/plugin_name/plugin_name_spec.lua
@@ -0,0 +1,12 @@
+local plugin = require("plugin_name")
+
+describe("setup", function()
+ it("works with default", function()
+ assert("my first function with param = Hello!", plugin.hello())
+ end)
+
+ it("works with custom var", function()
+ plugin.setup({ opt = "custom" })
+ assert("my first function with param = custom", plugin.hello())
+ end)
+end)