summaryrefslogtreecommitdiff
path: root/internal/cli/root_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-03 23:53:25 +0200
committerPaul Buetow <paul@buetow.org>2026-03-03 23:53:25 +0200
commit09b8aa9d74df0ef7d50858cd398efc8a952a1aad (patch)
tree66b77086b1f55c349d7edb32635a52566ca70c8d /internal/cli/root_test.go
parente785973bc3a0add31a7ff68a94b9ea5d43413b59 (diff)
cli: thread config via command context
Diffstat (limited to 'internal/cli/root_test.go')
-rw-r--r--internal/cli/root_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/cli/root_test.go b/internal/cli/root_test.go
index c900027..2b12514 100644
--- a/internal/cli/root_test.go
+++ b/internal/cli/root_test.go
@@ -12,8 +12,6 @@ import (
)
func TestRootVersionFlag(t *testing.T) {
- loadedConfig = CurrentConfig()
-
var out bytes.Buffer
cmd := NewRootCmd()
cmd.SetOut(&out)
@@ -51,7 +49,7 @@ func TestRootLoadsConfigInPersistentPreRun(t *testing.T) {
t.Fatalf("Execute() error = %v", err)
}
- cfg := CurrentConfig()
+ cfg := currentConfig(cmd)
if cfg.Hostname != "from-config" {
t.Fatalf("Hostname = %q, want %q", cfg.Hostname, "from-config")
}
@@ -116,7 +114,7 @@ func TestRootUsesDefaultConfigWhenNoFileExists(t *testing.T) {
t.Fatalf("Execute() error = %v", err)
}
- cfg := CurrentConfig()
+ cfg := currentConfig(cmd)
if cfg.WeekWorkHours != 40 {
t.Fatalf("WeekWorkHours = %v, want 40", cfg.WeekWorkHours)
}