cli can pass -db /path/to/sql.db

This commit is contained in:
Bel LaPointe
2025-05-07 19:45:52 -06:00
parent 2f503497e9
commit 49064f1ea2
4 changed files with 31 additions and 5 deletions

View File

@@ -2,6 +2,8 @@ package main_test
import (
"context"
"os"
"path"
main "show-rss"
"show-rss/src/db"
"testing"
@@ -12,6 +14,8 @@ func TestMain(t *testing.T) {
ctx, can := context.WithTimeout(context.Background(), 2*time.Second)
defer can()
os.Args = []string{os.Args[0], "-db", path.Join(t.TempDir(), "db.db")}
if err := main.Main(db.Test(t, ctx)); err != nil && ctx.Err() == nil {
t.Fatal(err)
}