MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestCleanCmd_Execute_ValidateTargetsError

Function TestCleanCmd_Execute_ValidateTargetsError

cmds/cmd_clean_test.go:374–387  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

372}
373
374func 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
389func TestCleanCmd_Execute_AllWithoutTargets(t *testing.T) {
390 celer := newInitializedCeler(t)

Callers

nothing calls this directly

Calls 4

CommandMethod · 0.95
IsFunction · 0.92
newInitializedCelerFunction · 0.85
runCommandFunction · 0.85

Tested by

no test coverage detected