(t *testing.T)
| 350 | } |
| 351 | |
| 352 | func TestFeedCommand_InvalidFormat(t *testing.T) { |
| 353 | resetFeedFlags() |
| 354 | feedFormat = "csv" |
| 355 | |
| 356 | oldGitLog := gitLogFunc |
| 357 | gitLogFunc = func(_ string, _ []string) (string, error) { |
| 358 | return "", nil |
| 359 | } |
| 360 | defer func() { gitLogFunc = oldGitLog }() |
| 361 | |
| 362 | oldGitShow := gitShowFunc |
| 363 | gitShowFunc = noopGitShow |
| 364 | defer func() { gitShowFunc = oldGitShow }() |
| 365 | |
| 366 | err := runFeed(feedCmd, nil) |
| 367 | if err == nil { |
| 368 | t.Fatal("expected error for invalid format") |
| 369 | } |
| 370 | if !strings.Contains(err.Error(), "unsupported format") { |
| 371 | t.Errorf("expected 'unsupported format' error, got: %v", err) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | func TestFeedCommand_NonGitRepo(t *testing.T) { |
| 376 | resetFeedFlags() |
nothing calls this directly
no test coverage detected