INNER CODE UNIT · Go
TestAgentsShow_NoArgs
jrswab/axe · cmd/agents_test.go:366
func TestAgentsShow_NoArgs(t *testing.T) {
buf := new(bytes.Buffer)
errBuf := new(bytes.Buffer)
rootCmd.SetOut(buf)
rootCmd.SetErr(errBuf)
rootCmd.SetArgs([]string{"agents", "show"})
err := rootCmd.Execute()
if err == nil {
t.Fatal("expected error for missing args, got nil")
}
if !strings.Contains(err.Error(), "missing required argument: <agent>") {
t.Errorf("error = %q, want to contain 'missing required argument: <agent>'", err.Error())
}
}
// --- Phase 10: agents init ---