TestAddMultipleWorkflowsNameFlag verifies that --name is not allowed when multiple workflows are specified.
(t *testing.T)
| 356 | |
| 357 | // TestAddMultipleWorkflowsNameFlag verifies that --name is not allowed when multiple workflows are specified. |
| 358 | func TestAddMultipleWorkflowsNameFlag(t *testing.T) { |
| 359 | cmd := NewAddCommand(validateEngineStub) |
| 360 | |
| 361 | // Simulate calling the command with --name and multiple workflow arguments |
| 362 | cmd.SetArgs([]string{"workflow1", "workflow2", "--name", "custom-name"}) |
| 363 | |
| 364 | err := cmd.Execute() |
| 365 | require.Error(t, err, "Should error when --name is used with multiple workflows") |
| 366 | assert.Contains(t, err.Error(), "--name flag cannot be used when adding multiple workflows", "Error should mention --name restriction") |
| 367 | } |
| 368 | |
| 369 | // setupMinimalGitRepo initialises a bare-minimum git repo in dir and returns the |
| 370 | // path to the .github/workflows directory so callers can write/read workflow files. |
nothing calls this directly
no test coverage detected