refactor(tests): remove boilerplate even further

This commit is contained in:
Oleksandr Smirnov 2025-03-22 20:16:32 +02:00
parent b2780c8efb
commit 2ca302a7a5
No known key found for this signature in database
6 changed files with 35 additions and 60 deletions

View file

@ -1,17 +1,9 @@
local t = require "spec.testutils"
local child = MiniTest.new_child_neovim()
local T = MiniTest.new_set {
hooks = {
post_once = child.stop,
pre_case = function()
child.restart { "-u", t.mininit_path }
end,
},
}
local child, T = t.setup()
T["impl"] = MiniTest.new_set {}
T["impl"]["works w io.Writer"] = function()
local rs = t.setup("impl/writer", child, { 3, 0 })
local rs = t.setup_test("impl/writer", child, { 3, 0 })
child.cmd "GoImpl w io.Writer"
child.cmd "write"
@ -22,7 +14,7 @@ T["impl"]["works w io.Writer"] = function()
end
T["impl"]["works r Read io.Reader"] = function()
local rs = t.setup("impl/reader", child)
local rs = t.setup_test("impl/reader", child)
child.cmd "GoImpl r Read io.Reader"
child.cmd "write"
@ -32,7 +24,7 @@ T["impl"]["works r Read io.Reader"] = function()
end
T["impl"]["works io.Closer"] = function()
local rs = t.setup("impl/closer", child, { 3, 6})
local rs = t.setup_test("impl/closer", child, { 3, 6 })
child.cmd "GoImpl io.Closer"
child.cmd "write"