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/hexaicli/run_output_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/hexaicli/run_output_test.go') diff --git a/internal/hexaicli/run_output_test.go b/internal/hexaicli/run_output_test.go index 07a2cab..2168e69 100644 --- a/internal/hexaicli/run_output_test.go +++ b/internal/hexaicli/run_output_test.go @@ -342,9 +342,7 @@ func TestCacheHitSummary_NegativeAge(t *testing.T) { func TestRunCLIJobs_MultiJob_WritesOutputs(t *testing.T) { // runCLIJobs with multiple jobs should call writeCLIJobOutputs // (the non-streaming, non-printer path). - oldNew := newClientFromApp - defer func() { newClientFromApp = oldNew }() - newClientFromApp = func(cfg appconfig.App) (llm.Client, error) { + clientFactory := func(cfg appconfig.App) (llm.Client, error) { return &fakeClient{name: cfg.Provider, model: "m", resp: "out-" + cfg.Provider}, nil } t.Setenv("XDG_CACHE_HOME", t.TempDir()) @@ -400,7 +398,7 @@ func TestRunCLIJobs_MultiJob_WritesOutputs(t *testing.T) { } stdout.Reset() stderr.Reset() - if err := runCLIJobs(context.Background(), singleJobs, msgs, "hello", &stdout, &stderr, newClientFromApp, nil); err != nil { + if err := runCLIJobs(context.Background(), singleJobs, msgs, "hello", &stdout, &stderr, clientFactory, nil); err != nil { t.Fatalf("runCLIJobs single: %v", err) } if !strings.Contains(stdout.String(), "out-a") { -- cgit v1.2.3