From 36a094ba1d29827f8bacdfe53e75692560385e16 Mon Sep 17 00:00:00 2001 From: Vladimir Sagan Date: Fri, 9 Sep 2016 17:55:28 +0300 Subject: [PATCH] fix tests and migration template --- lib/gorm-goose/dbconf_test.go | 16 +--------------- lib/gorm-goose/migration_go.go | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/gorm-goose/dbconf_test.go b/lib/gorm-goose/dbconf_test.go index 34200af..ebdf006 100644 --- a/lib/gorm-goose/dbconf_test.go +++ b/lib/gorm-goose/dbconf_test.go @@ -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" diff --git a/lib/gorm-goose/migration_go.go b/lib/gorm-goose/migration_go.go index 4bb70ca..8f2ad5b 100644 --- a/lib/gorm-goose/migration_go.go +++ b/lib/gorm-goose/migration_go.go @@ -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() {