From 09696900a53686288afed5c757b449b7b3be1c76 Mon Sep 17 00:00:00 2001 From: Olexandr Smirnov Date: Wed, 27 Aug 2025 20:56:07 +0300 Subject: [PATCH] test: add test for config --- spec/unit/config_test.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/unit/config_test.lua diff --git a/spec/unit/config_test.lua b/spec/unit/config_test.lua new file mode 100644 index 0000000..cfb844a --- /dev/null +++ b/spec/unit/config_test.lua @@ -0,0 +1,22 @@ +local t = require "spec.testutils" +local _, T = t.setup "config" + +T["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() + require("gopher").setup {} +end + +T["config"]["should change option"] = function() + local log_level = 1234567890 + require("gopher").setup { + log_level = log_level, + } + + t.eq(log_level, require("gopher.config").log_level) +end + +return T