(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestWatcherStart(t *testing.T) { |
| 53 | tmpDir := t.TempDir() |
| 54 | prdPath := createTestPRDMd(t, tmpDir, []UserStory{ |
| 55 | {ID: "US-001", Title: "Test Story", Passes: false}, |
| 56 | }) |
| 57 | |
| 58 | watcher, err := NewWatcher(prdPath) |
| 59 | if err != nil { |
| 60 | t.Fatalf("Failed to create watcher: %v", err) |
| 61 | } |
| 62 | defer watcher.Stop() |
| 63 | |
| 64 | if err := watcher.Start(); err != nil { |
| 65 | t.Fatalf("Failed to start watcher: %v", err) |
| 66 | } |
| 67 | |
| 68 | // Starting again should return an error |
| 69 | if err := watcher.Start(); err == nil { |
| 70 | t.Error("Expected error when starting watcher twice") |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestWatcherDetectsFileChange(t *testing.T) { |
| 75 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected