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

Function TestFeedCommand_SourceGit

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

Source from the content-addressed store, hash-verified

778}
779
780func TestFeedCommand_SourceGit(t *testing.T) {
781 resetFeedFlags()
782 feedSource = "git"
783 noColor = true
784 defer func() { noColor = false }()
785
786 oldGitLog := gitLogFunc
787 gitLogFunc = func(_ string, _ []string) (string, error) {
788 return sampleGitLogOutput, nil
789 }
790 defer func() { gitLogFunc = oldGitLog }()
791
792 oldGitShow := gitShowFunc
793 gitShowFunc = noopGitShow
794 defer func() { gitShowFunc = oldGitShow }()
795
796 output, err := captureFeedOutput(t, func() error {
797 return runFeed(feedCmd, nil)
798 })
799 if err != nil {
800 t.Fatalf("unexpected error: %v", err)
801 }
802
803 if strings.Contains(output, "[Worklog]") {
804 t.Error("expected no [Worklog] tag with --source git")
805 }
806 if !strings.Contains(output, "Alice") {
807 t.Error("expected git entries in output")
808 }
809}
810
811func TestFeedCommand_InvalidSource(t *testing.T) {
812 resetFeedFlags()

Callers

nothing calls this directly

Calls 4

resetFeedFlagsFunction · 0.85
captureFeedOutputFunction · 0.85
runFeedFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected