Skip to content

Commit

Permalink
add test for OptionsString
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrozetera authored and stanislas-m committed Dec 23, 2020
1 parent 81e5f2d commit 0e3d2e2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions connection_details_test.go
Expand Up @@ -84,3 +84,22 @@ func Test_ConnectionDetails_Finalize_NoDB_NoURL(t *testing.T) {
err := cd.Finalize()
r.Error(err)
}

func Test_ConnectionDetails_OptionsString_Postgres(t *testing.T) {
r := require.New(t)
cd := &ConnectionDetails{
Dialect: "postgres",
Database: "database",
Host: "host",
Port: "1234",
User: "user",
Password: "pass",
Options: map[string]string{
"migration_table_name": "migrations",
"sslmode": "require",
},
}

r.Equal("sslmode=require", cd.OptionsString(""))
r.Equal("migrations", cd.MigrationTableName())
}

0 comments on commit 0e3d2e2

Please sign in to comment.