Add WithDatabaseUrl to testing package

This commit is contained in:
Jeff Mitchell committed 2020-09-16 09:15:54 -04:00
1 parent 05c2e38f03
commit ab1f31e9af
1 file changed
+9
+9
View File
@@ -48,6 +48,7 @@ type option struct {
setDefaultLoginName bool
setDefaultPassword bool
setRecoveryKms bool
setDatabaseUrl bool
}
type Option func(*option) error
@@ -137,6 +138,14 @@ func WithRecoveryKms(wrapper wrapping.Wrapper) Option {
}
}
func WithDatabaseUrl(url string) Option {
return func(c *option) error {
c.setDatabaseUrl = true
c.tcOptions.DatabaseUrl = url
return nil
}
}
// NewTestController blocks until a new TestController is created, returns the url for the TestController and a function
// that can be called to tear down the controller after it has been used for testing.
func NewTestController(t *testing.T, opt ...Option) *TestController {