From a80ad2b4691d0df63f68c6977ee18444e7bb752f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 18 Jun 2026 08:05:32 +0300 Subject: ik0 replace remaining test seams with DI --- internal/askcli/command_write_test.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'internal/askcli/command_write_test.go') diff --git a/internal/askcli/command_write_test.go b/internal/askcli/command_write_test.go index e922920..453b005 100644 --- a/internal/askcli/command_write_test.go +++ b/internal/askcli/command_write_test.go @@ -5,7 +5,6 @@ import ( "context" "errors" "io" - "path/filepath" "strings" "testing" "time" @@ -15,15 +14,8 @@ func useIsolatedTaskAliasCache(t *testing.T) time.Time { t.Helper() dir := t.TempDir() - oldRoot := taskAliasCacheRoot - oldNow := nowTaskAliasCache fixedNow := time.Date(2026, 3, 26, 12, 0, 0, 0, time.UTC) - taskAliasCacheRoot = func() (string, error) { return filepath.Join(dir, "hexai"), nil } - nowTaskAliasCache = func() time.Time { return fixedNow } - t.Cleanup(func() { - taskAliasCacheRoot = oldRoot - nowTaskAliasCache = oldNow - }) + t.Setenv("XDG_CACHE_HOME", dir) return fixedNow } -- cgit v1.2.3