MCPcopy Create free account
hub / github.com/driangle/taskmd / TestFeedCommand_Since

Function TestFeedCommand_Since

apps/cli/internal/cli/feed_test.go:236–269  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

234}
235
236func 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
271func TestFeedCommand_Scope(t *testing.T) {
272 resetFeedFlags()

Callers

nothing calls this directly

Calls 3

resetFeedFlagsFunction · 0.85
captureFeedOutputFunction · 0.85
runFeedFunction · 0.85

Tested by

no test coverage detected