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

Function TestAddCommandFlagDefaults

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

Source from the content-addressed store, hash-verified

298}
299
300func TestAddCommandFlagDefaults(t *testing.T) {
301 cmd := NewAddCommand(validateEngineStub)
302 flags := cmd.Flags()
303
304 tests := []struct {
305 flagName string
306 defaultValue string
307 }{
308 {"name", ""},
309 {"engine", ""},
310 {"repo", ""},
311 {"append", ""},
312 {"dir", ""},
313 {"stop-after", ""},
314 }
315
316 for _, tt := range tests {
317 t.Run(tt.flagName, func(t *testing.T) {
318 flag := flags.Lookup(tt.flagName)
319 require.NotNil(t, flag, "Flag should exist: %s", tt.flagName)
320 assert.Equal(t, tt.defaultValue, flag.DefValue, "Default value should match for flag: %s", tt.flagName)
321 })
322 }
323}
324
325func TestAddCommandBooleanFlags(t *testing.T) {
326 cmd := NewAddCommand(validateEngineStub)

Callers

nothing calls this directly

Calls 2

NewAddCommandFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected