MCPcopy Create free account
hub / github.com/github/gh-aw / TestAddCommandArgs

Function TestAddCommandArgs

pkg/cli/add_command_test.go:340–355  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

338}
339
340func TestAddCommandArgs(t *testing.T) {
341 cmd := NewAddCommand(validateEngineStub)
342
343 // Test that Args validator is set (MinimumNArgs(1))
344 require.NotNil(t, cmd.Args, "Args validator should be set")
345
346 // Verify it requires at least 1 arg
347 err := cmd.Args(cmd, []string{})
348 require.Error(t, err, "Should error with no arguments")
349
350 err = cmd.Args(cmd, []string{"workflow1"})
351 require.NoError(t, err, "Should not error with 1 argument")
352
353 err = cmd.Args(cmd, []string{"workflow1", "workflow2"})
354 require.NoError(t, err, "Should not error with multiple arguments")
355}
356
357// TestAddMultipleWorkflowsNameFlag verifies that --name is not allowed when multiple workflows are specified.
358func TestAddMultipleWorkflowsNameFlag(t *testing.T) {

Callers

nothing calls this directly

Calls 2

NewAddCommandFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected