Documentation ¶
Overview ¶
Package db defines a godog feature context which adds steps to setup and verify database contents during tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBInitializeFn ¶
type FeatureContext ¶
type FeatureContext struct {
// contains filtered or unexported fields
}
FeatureContext adds steps to setup and verify database contents during godog tests.
func NewFeatureContext ¶
func NewFeatureContext(driver, dsn string, initDB DBInitializeFn) *FeatureContext
NewFeatureContext create a new feature context. It expects the db driver name, a connection DSN and an init functions which receives an instance of *sql.DB. The init function is called before every scenario and can be used to pass the db handle to the tested application or run setup like database migrations.
func (*FeatureContext) Register ¶
func (c *FeatureContext) Register(ctx *godog.ScenarioContext)
Register registers the feature context to the godog suite.
func (*FeatureContext) WithoutTxDB ¶
func (c *FeatureContext) WithoutTxDB()
Click to show internal directories.
Click to hide internal directories.