refactor(test): make helper test function more ergonomic
In my opinion, requiring user to access tests via `T["module_name"]` was too fragile and typos prone.
This commit is contained in:
parent
53ab4274c2
commit
e90f766ea3
8 changed files with 40 additions and 38 deletions
|
|
@ -1,16 +1,16 @@
|
|||
local t = require "spec.testutils"
|
||||
local _, T = t.setup "config"
|
||||
local _, T, config = t.setup "config"
|
||||
|
||||
T["config"]["can be called without any arguments passed"] = function()
|
||||
config["can be called without any arguments passed"] = function()
|
||||
---@diagnostic disable-next-line: missing-parameter
|
||||
require("gopher").setup()
|
||||
end
|
||||
|
||||
T["config"]["can be called with empty table"] = function()
|
||||
config["can be called with empty table"] = function()
|
||||
require("gopher").setup {}
|
||||
end
|
||||
|
||||
T["config"]["should change option"] = function()
|
||||
config["should change option"] = function()
|
||||
local log_level = 1234567890
|
||||
require("gopher").setup {
|
||||
log_level = log_level,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue