INNER CODE UNIT · Go

TestAgentsEdit_MissingAgent

jrswab/axe · cmd/agents_test.go:514

func TestAgentsEdit_MissingAgent(t *testing.T) {
	_ = setupTestAgentsDir(t)
	t.Setenv("EDITOR", "vim")

	buf := new(bytes.Buffer)
	errBuf := new(bytes.Buffer)
	rootCmd.SetOut(buf)
	rootCmd.SetErr(errBuf)
	rootCmd.SetArgs([]string{"agents", "edit", "nonexistent"})

	err := rootCmd.Execute()
	if err == nil {
		t.Fatal("expected error for missing agent, got nil")
	}
	if !strings.Contains(err.Error(), "agent config not found: nonexistent") {
		t.Errorf("error = %q, want to contain 'agent config not found: nonexistent'", err.Error())
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…