Files
beads/cmd/bd
Steve Yegge 227e76b215 test: Refactor Phase 2 test files to use shared DB pattern (bd-1rh)
Refactored 3 smaller test files for test suite optimization:

FILES ANALYZED:
- validate_test.go (9 tests): NO DB needed - pure validation logic
- epic_test.go (3 tests): 2 DB setups → 1 shared pattern
- duplicates_test.go (5 tests): 1 old setupTestDB → newTestStore

CHANGES:
epic_test.go:
- Replaced 2× manual sqlite.New() with newTestStore()
- Removed duplicate SetConfig calls
- Removed manual Close/defer (handled by helper)
- -40 lines, +6 lines = net -34 lines

duplicates_test.go:
- Replaced old setupTestDB pattern with newTestStore
- Updated test data: bd-1/2/3 → test-1/2/3 (matches prefix)
- Added filepath import
- Removed cleanup() function pattern
- Net changes: proper shared pattern adoption

METRICS:
- Total files changed: 2/3 (validate_test.go needs no DB!)
- DB setups eliminated: 3 → 1 (epic: 2→1, duplicates: 1→0+shared)
- Lines saved: 30 net reduction
- Tests passing: 13/13 ✓

validate_test.go required NO changes - all tests are pure functions
with in-memory data. Even git conflict tests use temp files, not DB.

Part of Phase 2/3 test suite optimization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 16:14:27 -05:00
..
2025-11-20 22:15:04 -05:00
2025-11-09 14:53:59 -08:00
2025-11-17 10:12:46 -07:00
2025-11-09 14:13:48 -08:00
2025-11-20 21:54:11 -05:00
2025-11-09 14:53:59 -08:00
2025-11-17 10:12:46 -07:00
2025-11-20 22:15:04 -05:00