Files
beads/cmd/bd/setup/codex_test.go
matt wilkie ce622f5688 feat(setup): add Codex CLI setup recipe (#1243)
* Add Codex setup recipe

* Sync beads issues (bd-1zo)

---------

Co-authored-by: Amp <amp@example.com>
2026-01-21 21:50:01 -08:00

37 lines
864 B
Go

package setup
import (
"strings"
"testing"
)
func stubCodexEnvProvider(t *testing.T, env agentsEnv) {
t.Helper()
orig := codexEnvProvider
codexEnvProvider = func() agentsEnv {
return env
}
t.Cleanup(func() { codexEnvProvider = orig })
}
func TestInstallCodexCreatesNewFile(t *testing.T) {
env, stdout, _ := newFactoryTestEnv(t)
if err := installCodex(env); err != nil {
t.Fatalf("installCodex returned error: %v", err)
}
if !strings.Contains(stdout.String(), "Codex CLI integration installed") {
t.Error("expected Codex install success message")
}
}
func TestCheckCodexMissingFile(t *testing.T) {
env, stdout, _ := newFactoryTestEnv(t)
err := checkCodex(env)
if err == nil {
t.Fatal("expected error for missing AGENTS.md")
}
if !strings.Contains(stdout.String(), "bd setup codex") {
t.Error("expected setup guidance for codex")
}
}