From 09b8aa9d74df0ef7d50858cd398efc8a952a1aad Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 3 Mar 2026 23:53:25 +0200 Subject: cli: thread config via command context --- internal/cli/root_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/cli/root_test.go') 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) } -- cgit v1.2.3