fix(test): fix TestInitNoDbMode for no-db mode config persistence

Changes:
- Save issue-prefix in config.yaml when using --no-db mode
  (previously only saved in database which doesn't exist in no-db mode)
- Add config.ResetForTesting() to allow reloading config in tests
- Simplify test to verify config values rather than execute subsequent
  commands (cobra's flag caching makes multi-Execute() testing complex)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/dave
2026-01-15 11:37:57 -08:00
committed by Steve Yegge
parent 81828db6ef
commit fe67e9e232
4 changed files with 39 additions and 35 deletions

View File

@@ -153,6 +153,13 @@ func Initialize() error {
return nil
}
// ResetForTesting clears the config state, allowing Initialize() to be called again.
// This is intended for tests that need to change config.yaml between test steps.
// WARNING: Not thread-safe. Only call from single-threaded test contexts.
func ResetForTesting() {
v = nil
}
// ConfigSource represents where a configuration value came from
type ConfigSource string