(t *testing.T)
| 211 | } |
| 212 | |
| 213 | func TestCreateCmd_CommandExecutionValidation(t *testing.T) { |
| 214 | t.Run("empty project value should fail", func(t *testing.T) { |
| 215 | celer := newInitializedCeler(t) |
| 216 | cmd := &createCmd{} |
| 217 | |
| 218 | stderr, err := runCommand(t, cmd.Command(celer), "--project=") |
| 219 | if err == nil { |
| 220 | t.Fatal("expected error when --project is set with empty value") |
| 221 | } |
| 222 | if !strings.Contains(stderr, "cannot be empty") { |
| 223 | t.Fatalf("stderr should report empty value, got:\n%s", stderr) |
| 224 | } |
| 225 | }) |
| 226 | |
| 227 | t.Run("positional args should fail", func(t *testing.T) { |
| 228 | celer := newInitializedCeler(t) |
| 229 | cmd := &createCmd{} |
| 230 | |
| 231 | // cobra.NoArgs handles this — error comes from cobra, not from RunE. |
| 232 | _, err := runCommand(t, cmd.Command(celer), "unexpected-arg", "--project=test_project") |
| 233 | if err == nil { |
| 234 | t.Fatal("expected error when positional args are provided") |
| 235 | } |
| 236 | }) |
| 237 | } |
| 238 | |
| 239 | func TestCreateCmd(t *testing.T) { |
| 240 | celer := newInitializedCeler(t) |
nothing calls this directly
no test coverage detected