(t *testing.T)
| 234 | } |
| 235 | |
| 236 | func TestFeedCommand_Since(t *testing.T) { |
| 237 | resetFeedFlags() |
| 238 | feedSince = "7d" |
| 239 | |
| 240 | var capturedArgs []string |
| 241 | oldGitLog := gitLogFunc |
| 242 | gitLogFunc = func(_ string, args []string) (string, error) { |
| 243 | capturedArgs = args |
| 244 | return "", nil |
| 245 | } |
| 246 | defer func() { gitLogFunc = oldGitLog }() |
| 247 | |
| 248 | oldGitShow := gitShowFunc |
| 249 | gitShowFunc = noopGitShow |
| 250 | defer func() { gitShowFunc = oldGitShow }() |
| 251 | |
| 252 | _, err := captureFeedOutput(t, func() error { |
| 253 | return runFeed(feedCmd, nil) |
| 254 | }) |
| 255 | if err != nil { |
| 256 | t.Fatalf("unexpected error: %v", err) |
| 257 | } |
| 258 | |
| 259 | found := false |
| 260 | for _, arg := range capturedArgs { |
| 261 | if arg == "--since=7.days.ago" { |
| 262 | found = true |
| 263 | break |
| 264 | } |
| 265 | } |
| 266 | if !found { |
| 267 | t.Errorf("expected --since=7.days.ago in git args, got: %v", capturedArgs) |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | func TestFeedCommand_Scope(t *testing.T) { |
| 272 | resetFeedFlags() |
nothing calls this directly
no test coverage detected