cli can pass -db /path/to/sql.db
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user