summaryrefslogtreecommitdiff
path: root/internal/hexaicli/run_output_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-18 08:05:32 +0300
committerPaul Buetow <paul@buetow.org>2026-06-18 08:05:32 +0300
commita80ad2b4691d0df63f68c6977ee18444e7bb752f (patch)
tree6edc47fcc3c929856826432cf3df3394a14934e8 /internal/hexaicli/run_output_test.go
parent4ffb22e7f69f1c9c79b095d4e60bad3d97aac55b (diff)
ik0 replace remaining test seams with DI
Diffstat (limited to 'internal/hexaicli/run_output_test.go')
-rw-r--r--internal/hexaicli/run_output_test.go6
1 files changed, 2 insertions, 4 deletions
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") {