Skip to content

Commit

Permalink
fix: change assert parameters (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh authored Jan 18, 2024
1 parent e501d3d commit 25d576b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lua/plugin_name.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ M.setup = function(args)
end

M.hello = function()
module.my_first_function()
return module.my_first_function(M.config.opt)
end

return M
4 changes: 2 additions & 2 deletions lua/plugin_name/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
local M = {}

---@return string
M.my_first_function = function()
return "hello world!"
M.my_first_function = function(greeting)
return greeting
end

return M
4 changes: 2 additions & 2 deletions tests/plugin_name/plugin_name_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ local plugin = require("plugin_name")

describe("setup", function()
it("works with default", function()
assert("my first function with param = Hello!", plugin.hello())
assert(plugin.hello() == "Hello!", "my first function with param = Hello!")
end)

it("works with custom var", function()
plugin.setup({ opt = "custom" })
assert("my first function with param = custom", plugin.hello())
assert(plugin.hello() == "custom", "my first function with param = custom")
end)
end)

0 comments on commit 25d576b

Please sign in to comment.