From 7248671c9a7ec5dfe4b8a75e8efa89575d70ae19 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sat, 28 May 2016 13:49:32 -0300 Subject: [PATCH] Allow run tests for SQLite on Windows --- main_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index 8ac015c8..35dc0b0b 100644 --- a/main_test.go +++ b/main_test.go @@ -5,6 +5,7 @@ import ( "database/sql/driver" "fmt" "os" + "path/filepath" "reflect" "strconv" "testing" @@ -61,7 +62,7 @@ func OpenTestConnection() (db *gorm.DB, err error) { db, err = gorm.Open("mssql", "server=SERVER_HERE;database=rogue;user id=USER_HERE;password=PW_HERE;port=1433") default: fmt.Println("testing sqlite3...") - db, err = gorm.Open("sqlite3", "/tmp/gorm.db") + db, err = gorm.Open("sqlite3", filepath.Join(os.TempDir(), "gorm.db")) } return }