(t *testing.T)
| 299 | } |
| 300 | |
| 301 | func TestFeedCommand_EmptyFeed(t *testing.T) { |
| 302 | resetFeedFlags() |
| 303 | |
| 304 | oldGitLog := gitLogFunc |
| 305 | gitLogFunc = func(_ string, _ []string) (string, error) { |
| 306 | return "", nil |
| 307 | } |
| 308 | defer func() { gitLogFunc = oldGitLog }() |
| 309 | |
| 310 | oldGitShow := gitShowFunc |
| 311 | gitShowFunc = noopGitShow |
| 312 | defer func() { gitShowFunc = oldGitShow }() |
| 313 | |
| 314 | output, err := captureFeedOutput(t, func() error { |
| 315 | return runFeed(feedCmd, nil) |
| 316 | }) |
| 317 | if err != nil { |
| 318 | t.Fatalf("unexpected error: %v", err) |
| 319 | } |
| 320 | |
| 321 | if !strings.Contains(output, "No recent task changes.") { |
| 322 | t.Errorf("expected empty feed message, got: %s", output) |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | func TestFeedCommand_EmptyFeed_JSON(t *testing.T) { |
| 327 | resetFeedFlags() |
nothing calls this directly
no test coverage detected