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

Function TestFeedCommand_NonGitRepo

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

Source from the content-addressed store, hash-verified

373}
374
375func TestFeedCommand_NonGitRepo(t *testing.T) {
376 resetFeedFlags()
377
378 oldGitLog := gitLogFunc
379 gitLogFunc = func(_ string, _ []string) (string, error) {
380 return "", fmt.Errorf("not a git repository")
381 }
382 defer func() { gitLogFunc = oldGitLog }()
383
384 oldGitShow := gitShowFunc
385 gitShowFunc = noopGitShow
386 defer func() { gitShowFunc = oldGitShow }()
387
388 err := runFeed(feedCmd, nil)
389 if err == nil {
390 t.Fatal("expected error for non-git repo")
391 }
392 if !strings.Contains(err.Error(), "git repository") {
393 t.Errorf("expected git repository error, got: %v", err)
394 }
395}
396
397func TestExtractTaskIDFromPath(t *testing.T) {
398 tests := []struct {

Callers

nothing calls this directly

Calls 3

resetFeedFlagsFunction · 0.85
runFeedFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected