Skip to content

Commit 25d576b

Browse files
authored
fix: change assert parameters (#10)
1 parent e501d3d commit 25d576b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lua/plugin_name.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ M.setup = function(args)
2121
end
2222

2323
M.hello = function()
24-
module.my_first_function()
24+
return module.my_first_function(M.config.opt)
2525
end
2626

2727
return M

lua/plugin_name/module.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
local M = {}
33

44
---@return string
5-
M.my_first_function = function()
6-
return "hello world!"
5+
M.my_first_function = function(greeting)
6+
return greeting
77
end
88

99
return M

tests/plugin_name/plugin_name_spec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ local plugin = require("plugin_name")
22

33
describe("setup", function()
44
it("works with default", function()
5-
assert("my first function with param = Hello!", plugin.hello())
5+
assert(plugin.hello() == "Hello!", "my first function with param = Hello!")
66
end)
77

88
it("works with custom var", function()
99
plugin.setup({ opt = "custom" })
10-
assert("my first function with param = custom", plugin.hello())
10+
assert(plugin.hello() == "custom", "my first function with param = custom")
1111
end)
1212
end)

0 commit comments

Comments
 (0)