Add additional tests for postgres driver

This commit is contained in:
Adrian Macneil 2015-11-28 22:31:55 -07:00
parent c6aba53e51
commit e87dd1e608
5 changed files with 164 additions and 37 deletions

21
driver/driver_test.go Normal file
View file

@ -0,0 +1,21 @@
package driver_test
import (
"github.com/adrianmacneil/dbmate/driver"
"github.com/adrianmacneil/dbmate/driver/postgres"
"github.com/stretchr/testify/require"
"testing"
)
func TestGet_Postgres(t *testing.T) {
drv, err := driver.Get("postgres")
require.Nil(t, err)
_, ok := drv.(postgres.Driver)
require.Equal(t, true, ok)
}
func TestGet_Error(t *testing.T) {
drv, err := driver.Get("foo")
require.Equal(t, "Unknown driver: foo", err.Error())
require.Nil(t, drv)
}