From 1c414d807e36af4520912c88f9b8ef93467dce38 Mon Sep 17 00:00:00 2001 From: Giuseppe Gadola <67549788+giusgad@users.noreply.github.com> Date: Sat, 28 Jan 2023 14:34:42 +0100 Subject: Initial commit --- tests/minimal_init.lua | 11 +++++++++++ tests/plugin_name/plugin_name_spec.lua | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/minimal_init.lua create mode 100644 tests/plugin_name/plugin_name_spec.lua (limited to 'tests') 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) -- cgit v1.3-2-g11bf