feat(setup): add Codex CLI setup recipe (#1243)
* Add Codex setup recipe * Sync beads issues (bd-1zo) --------- Co-authored-by: Amp <amp@example.com>
This commit is contained in:
36
cmd/bd/setup/codex_test.go
Normal file
36
cmd/bd/setup/codex_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user