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

Function TestCommitMsg_MultiTaskWithBody

apps/cli/internal/cli/commit_msg_test.go:387–416  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

385}
386
387func TestCommitMsg_MultiTaskWithBody(t *testing.T) {
388 tmpDir := createCommitMsgTestFiles(t)
389 resetCommitMsgFlags()
390 taskDir = tmpDir
391 commitMsgBody = true
392
393 mockGitDiffAndRoot(t,
394 "diff --git a/cli/042-feature.md b/cli/042-feature.md\n"+
395 "+++ b/cli/042-feature.md\n"+
396 "+status: completed\n"+
397 "diff --git a/cli/043-bugfix.md b/cli/043-bugfix.md\n"+
398 "+++ b/cli/043-bugfix.md\n"+
399 "+status: completed\n",
400 tmpDir)
401
402 output, err := captureCommitMsgOutput(t)
403 if err != nil {
404 t.Fatalf("unexpected error: %v", err)
405 }
406
407 if !strings.Contains(output, "Add commit-msg command:") {
408 t.Errorf("expected task title section in body, got:\n%s", output)
409 }
410 if !strings.Contains(output, "- Create command scaffolding") {
411 t.Errorf("expected subtask from first task, got:\n%s", output)
412 }
413 if !strings.Contains(output, "Fix output formatting:") {
414 t.Errorf("expected second task title section, got:\n%s", output)
415 }
416}
417
418func TestCommitMsg_MultiTaskShort(t *testing.T) {
419 tmpDir := createCommitMsgTestFiles(t)

Callers

nothing calls this directly

Calls 4

createCommitMsgTestFilesFunction · 0.85
resetCommitMsgFlagsFunction · 0.85
mockGitDiffAndRootFunction · 0.85
captureCommitMsgOutputFunction · 0.85

Tested by

no test coverage detected