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

Function TestFeedCommand_InvalidFormat

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

Source from the content-addressed store, hash-verified

350}
351
352func 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
375func TestFeedCommand_NonGitRepo(t *testing.T) {
376 resetFeedFlags()

Callers

nothing calls this directly

Calls 3

resetFeedFlagsFunction · 0.85
runFeedFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected