From 4ffb22e7f69f1c9c79b095d4e60bad3d97aac55b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 18 Jun 2026 07:45:37 +0300 Subject: ik0 replace test seams with dependency injection --- internal/hexaiaction/custom_action_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'internal/hexaiaction/custom_action_test.go') diff --git a/internal/hexaiaction/custom_action_test.go b/internal/hexaiaction/custom_action_test.go index e2f7902..7bda0ad 100644 --- a/internal/hexaiaction/custom_action_test.go +++ b/internal/hexaiaction/custom_action_test.go @@ -3,11 +3,9 @@ package hexaiaction import ( "bytes" "context" - "os" "testing" "codeberg.org/snonux/hexai/internal/appconfig" - "codeberg.org/snonux/hexai/internal/editor" "codeberg.org/snonux/hexai/internal/llm" ) @@ -29,12 +27,9 @@ func TestActionCustom_UsesEditorPrompt(t *testing.T) { } runner.newClient = func(_ appconfig.App) (actionClient, error) { return llmFake2{}, nil } - oldRunEd := editor.RunEditor - editor.RunEditor = func(_ context.Context, _ string, path string) error { - return os.WriteFile(path, []byte("make it done"), 0o600) + runner.openEditor = func(context.Context, []byte) (string, error) { + return "make it done", nil } - t.Cleanup(func() { editor.RunEditor = oldRunEd }) - t.Setenv("HEXAI_EDITOR", "dummy") in := bytes.NewBufferString("some code") var out bytes.Buffer -- cgit v1.2.3