diff --git a/cmd/bd/epic_test.go b/cmd/bd/epic_test.go index 5b57298f..a29f8ae2 100644 --- a/cmd/bd/epic_test.go +++ b/cmd/bd/epic_test.go @@ -3,29 +3,17 @@ package main import ( "context" "fmt" - "os" "path/filepath" "testing" "time" - "github.com/steveyegge/beads/internal/storage/sqlite" "github.com/steveyegge/beads/internal/types" ) func TestEpicCommand(t *testing.T) { tmpDir := t.TempDir() - dbPath := filepath.Join(tmpDir, ".beads", "beads.db") - - if err := os.MkdirAll(filepath.Dir(dbPath), 0755); err != nil { - t.Fatal(err) - } - - sqliteStore, err := sqlite.New(context.Background(), dbPath) - if err != nil { - t.Fatal(err) - } - defer sqliteStore.Close() - + testDB := filepath.Join(tmpDir, ".beads", "beads.db") + sqliteStore := newTestStore(t, testDB) ctx := context.Background() // Set issue_prefix @@ -146,18 +134,8 @@ func TestEpicCommandInit(t *testing.T) { func TestEpicEligibleForClose(t *testing.T) { tmpDir := t.TempDir() - dbPath := filepath.Join(tmpDir, ".beads", "beads.db") - - if err := os.MkdirAll(filepath.Dir(dbPath), 0755); err != nil { - t.Fatal(err) - } - - sqliteStore, err := sqlite.New(context.Background(), dbPath) - if err != nil { - t.Fatal(err) - } - defer sqliteStore.Close() - + testDB := filepath.Join(tmpDir, ".beads", "beads.db") + sqliteStore := newTestStore(t, testDB) ctx := context.Background() // Set issue_prefix