mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +01:00
20 lines
416 B
Go
20 lines
416 B
Go
package driver
|
|
|
|
import (
|
|
"github.com/adrianmacneil/dbmate/driver/postgres"
|
|
"github.com/stretchr/testify/require"
|
|
"testing"
|
|
)
|
|
|
|
func TestGet_Postgres(t *testing.T) {
|
|
drv, err := Get("postgres")
|
|
require.Nil(t, err)
|
|
_, ok := drv.(postgres.Driver)
|
|
require.Equal(t, true, ok)
|
|
}
|
|
|
|
func TestGet_Error(t *testing.T) {
|
|
drv, err := Get("foo")
|
|
require.Equal(t, "Unknown driver: foo", err.Error())
|
|
require.Nil(t, drv)
|
|
}
|