fix tests and migration template

This commit is contained in:
Vladimir Sagan 2016-09-09 17:55:28 +03:00
parent a4bbc26e1e
commit 36a094ba1d
2 changed files with 2 additions and 16 deletions

View File

@ -13,7 +13,7 @@ func TestBasics(t *testing.T) {
}
got := []string{dbconf.MigrationsDir, dbconf.Env, dbconf.Driver.Name, dbconf.Driver.OpenStr}
want := []string{"../../db-sample/migrations", "test", "postgres", "user=liam dbname=tester sslmode=disable"}
want := []string{"../../db-sample/migrations", "test", "mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local"}
for i, s := range got {
if s != want[i] {
@ -22,20 +22,6 @@ func TestBasics(t *testing.T) {
}
}
func TestImportOverride(t *testing.T) {
dbconf, err := NewDBConf("../../db-sample", "customimport", "")
if err != nil {
t.Fatal(err)
}
got := dbconf.Driver.Import
want := "github.com/custom/driver"
if got != want {
t.Errorf("bad custom import. got %v want %v", got, want)
}
}
func TestDriverSetFromEnvironmentVariable(t *testing.T) {
databaseUrlEnvVariableKey := "DB_DRIVER"

View File

@ -97,7 +97,7 @@ import (
"encoding/gob"
_ "{{.Import}}"
"github.com/Altoros/gorm-goose/lib/goose"
goose "github.com/Altoros/gorm-goose/lib/gorm-goose"
)
func main() {