From 0e3d2e2e96149bd7e531cfbd8173dd3d30509e27 Mon Sep 17 00:00:00 2001 From: kyrozetera Date: Tue, 22 Dec 2020 23:54:51 -0600 Subject: [PATCH] add test for OptionsString --- connection_details_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/connection_details_test.go b/connection_details_test.go index 4121745a..877c8418 100644 --- a/connection_details_test.go +++ b/connection_details_test.go @@ -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()) +}