refactor(tests): start migration to mini.test

This commit is contained in:
Smirnov Oleksandr 2024-07-23 19:00:26 +03:00
parent 6769cafc55
commit 30a26bcda2
8 changed files with 35 additions and 29 deletions

View file

@ -0,0 +1,31 @@
local eq = MiniTest.expect.equality
describe("gopher.config", function()
it(".setup() should provide default when .setup() is not called", function()
local c = require "gopher.config"
eq(c.commands.go, "go")
eq(c.commands.gomodifytags, "gomodifytags")
eq(c.commands.gotests, "gotests")
eq(c.commands.impl, "impl")
eq(c.commands.iferr, "iferr")
eq(c.commands.dlv, "dlv")
end)
it(".setup() should change options on users config", function()
local c = require "gopher.config"
c.setup {
commands = {
go = "go1.420",
gomodifytags = "iDontUseRustBtw",
},
}
eq(c.commands.go, "go1.420")
eq(c.commands.gomodifytags, "iDontUseRustBtw")
eq(c.commands.gotests, "gotests")
eq(c.commands.impl, "impl")
eq(c.commands.iferr, "iferr")
eq(c.commands.dlv, "dlv")
end)
end)