(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func TestValidateOutputFormatRejectsInvalidValue(t *testing.T) { |
| 137 | cmd := &cobra.Command{} |
| 138 | cmd.Flags().String(outputFlag, "yaml", "") |
| 139 | |
| 140 | err := validateOutputFormat(cmd) |
| 141 | if err == nil { |
| 142 | t.Fatal("expected invalid output format to fail") |
| 143 | } |
| 144 | if !strings.Contains(err.Error(), `unsupported output format "yaml": use text or json`) { |
| 145 | t.Fatalf("error = %q, want unsupported output format", err.Error()) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | func TestValidateOutputFormatRejectsUnsupportedJSONCommand(t *testing.T) { |
| 150 | cmd := &cobra.Command{} |
nothing calls this directly
no test coverage detected