(t *testing.T)
| 372 | } |
| 373 | |
| 374 | func TestCleanCmd_Execute_ValidateTargetsError(t *testing.T) { |
| 375 | celer := newInitializedCeler(t) |
| 376 | cmd := &cleanCmd{} |
| 377 | |
| 378 | // `celer clean` without any target and without --all must fail at cobra's |
| 379 | // Args validator (validateArgs requires at least one argument unless --all). |
| 380 | stderr, err := runCommand(t, cmd.Command(celer)) |
| 381 | if err == nil { |
| 382 | t.Fatal("expected validation error for empty targets") |
| 383 | } |
| 384 | if !errors.Is(errors.ErrNoCleanFlagProvided, err) { |
| 385 | t.Fatalf("error should mention missing argument, got: %v (stderr=%s)", err, stderr) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | func TestCleanCmd_Execute_AllWithoutTargets(t *testing.T) { |
| 390 | celer := newInitializedCeler(t) |
nothing calls this directly
no test coverage detected