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/dispatch.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'internal/askcli/dispatch.go') diff --git a/internal/askcli/dispatch.go b/internal/askcli/dispatch.go index cdfc1d8..c1976f1 100644 --- a/internal/askcli/dispatch.go +++ b/internal/askcli/dispatch.go @@ -20,10 +20,13 @@ type Runner interface { // uses the real time.Ticker-backed factory installed by NewDispatcher; tests // inject a fake ticker so they can drive the watch loop without real delays. type Dispatcher struct { - runner Runner - jsonOutput bool - newTicker func(time.Duration) watchTicker - capture func(context.Context, []byte) (string, error) + runner Runner + jsonOutput bool + newTicker func(time.Duration) watchTicker + capture func(context.Context, []byte) (string, error) + aliasCache taskAliasCacheDeps + findTaskBinary func() (string, error) + runTaskCommand taskCommandRunner } // NewDispatcher creates a Dispatcher backed by the provided Runner or a default @@ -35,9 +38,12 @@ func NewDispatcher(runner Runner) *Dispatcher { runner = &e } return &Dispatcher{ - runner: runner, - newTicker: newRealWatchTicker, - capture: editorCapture, + runner: runner, + newTicker: newRealWatchTicker, + capture: editorCapture, + aliasCache: defaultTaskAliasCacheDeps(), + findTaskBinary: findTaskBinary, + runTaskCommand: runTaskCommand, } } -- cgit v1.2.3