MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestManagerUpdateWorktreeInfo

Function TestManagerUpdateWorktreeInfo

internal/loop/manager_test.go:554–579  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

552}
553
554func TestManagerUpdateWorktreeInfo(t *testing.T) {
555 tmpDir := t.TempDir()
556 prdPath := createTestPRDWithName(t, tmpDir, "test-prd")
557
558 m := NewManager(10, testProvider)
559 m.Register("test-prd", prdPath)
560
561 // Initially no worktree info
562 inst := m.GetInstance("test-prd")
563 if inst.WorktreeDir != "" || inst.Branch != "" {
564 t.Error("expected empty worktree info initially")
565 }
566
567 // Update worktree info
568 if err := m.UpdateWorktreeInfo("test-prd", "/tmp/wt/test", "chief/test"); err != nil {
569 t.Fatalf("unexpected error: %v", err)
570 }
571
572 inst = m.GetInstance("test-prd")
573 if inst.WorktreeDir != "/tmp/wt/test" {
574 t.Errorf("expected WorktreeDir /tmp/wt/test, got %s", inst.WorktreeDir)
575 }
576 if inst.Branch != "chief/test" {
577 t.Errorf("expected Branch chief/test, got %s", inst.Branch)
578 }
579}
580
581func TestManagerUpdateWorktreeInfoNotFound(t *testing.T) {
582 m := NewManager(10, testProvider)

Callers

nothing calls this directly

Calls 5

RegisterMethod · 0.95
GetInstanceMethod · 0.95
UpdateWorktreeInfoMethod · 0.95
createTestPRDWithNameFunction · 0.85
NewManagerFunction · 0.85

Tested by

no test coverage detected