You've already forked go-sqlmock
mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-07-03 00:36:52 +02:00
Add ExpectPing to watch for db Ping calls
This commit is contained in:
16
options.go
16
options.go
@ -20,3 +20,19 @@ func QueryMatcherOption(queryMatcher QueryMatcher) func(*sqlmock) error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// MonitorPingsOption determines whether calls to Ping on the driver should be
|
||||
// observed and mocked.
|
||||
//
|
||||
// If true is passed, we will check these calls were expected. Expectations can
|
||||
// be registered using the ExpectPing() method on the mock.
|
||||
//
|
||||
// If false is passed or this option is omitted, calls to Ping will not be
|
||||
// considered when determining expectations and calls to ExpectPing will have
|
||||
// no effect.
|
||||
func MonitorPingsOption(monitorPings bool) func(*sqlmock) error {
|
||||
return func(s *sqlmock) error {
|
||||
s.monitorPings = monitorPings
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user