TestNewValidateCommand tests that the validate command is created correctly
(t *testing.T)
| 11 | |
| 12 | // TestNewValidateCommand tests that the validate command is created correctly |
| 13 | func TestNewValidateCommand(t *testing.T) { |
| 14 | cmd := NewValidateCommand(func(string) error { return nil }) |
| 15 | |
| 16 | require.NotNil(t, cmd, "NewValidateCommand should return a non-nil command") |
| 17 | assert.Equal(t, "validate", cmd.Name(), "Command name should be 'validate'") |
| 18 | assert.NotEmpty(t, cmd.Short, "Command should have a short description") |
| 19 | assert.NotEmpty(t, cmd.Long, "Command should have a long description") |
| 20 | |
| 21 | // Verify key flags exist |
| 22 | require.NotNil(t, cmd.Flags().Lookup("dir"), "validate command should have a --dir flag") |
| 23 | assert.Equal(t, "d", cmd.Flags().Lookup("dir").Shorthand, "--dir flag should have -d shorthand") |
| 24 | require.NotNil(t, cmd.Flags().Lookup("json"), "validate command should have a --json flag") |
| 25 | assert.Equal(t, "j", cmd.Flags().Lookup("json").Shorthand, "--json flag should have -j shorthand") |
| 26 | require.NotNil(t, cmd.Flags().Lookup("engine"), "validate command should have a --engine flag") |
| 27 | strictFlag := cmd.Flags().Lookup("strict") |
| 28 | require.NotNil(t, strictFlag, "validate command should have a --strict flag") |
| 29 | assert.Contains(t, strictFlag.Usage, "disallows write permissions and deprecated fields") |
| 30 | require.NotNil(t, cmd.Flags().Lookup("fail-fast"), "validate command should have a --fail-fast flag") |
| 31 | require.NotNil(t, cmd.Flags().Lookup("stats"), "validate command should have a --stats flag") |
| 32 | require.NotNil(t, cmd.Flags().Lookup("no-check-update"), "validate command should have a --no-check-update flag") |
| 33 | require.NotNil(t, cmd.Flags().Lookup("validate-images"), "validate command should have a --validate-images flag") |
| 34 | } |
nothing calls this directly
no test coverage detected