Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell represents a data table cell.
type DataTable ¶
type DataTable struct {
// contains filtered or unexported fields
}
DataTable wraps a data table step argument
func (DataTable) HeaderTable ¶
func (d DataTable) HeaderTable() *HeaderTable
HeaderTable returns the data table as a header table which is a wrapper around the table which assumes that the first row is the table header.
type HeaderTable ¶
type HeaderTable struct {
DataTable
// contains filtered or unexported fields
}
HeaderTable is a wrapper around a table which assumes that the first row is \ the table header.
func (*HeaderTable) Get ¶
func (h *HeaderTable) Get(row int, col string) *Cell
Get returns the cell at the provided row offset (skipping the header row) and column name (as indicated in the header).
func (*HeaderTable) NumRows ¶
func (h *HeaderTable) NumRows() int
NumRows returns the number of rows in the table (excluding the header row).
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is a test runner.
func NewRunner ¶
NewRunner constructs a new Runner with the provided initScenario function. initScenario will be called for each test case returning a new suite instance for each test case which can be used for sharing state between steps. It is expected that the suite will retain a copy of the TestingT instance for usage in each step.
func (*Runner) NonParallel ¶
NonParallel instructs the runner not to run tests in parallel (which is the default).
func (*Runner) Step ¶
Step can be used to manually register a step with the runner. step should be a string or *regexp.Regexp instance. definition should be a function which takes the suite as its first argument (usually an instance method), parameter arguments next (with string, int64, *big.Int, and *apd.Decimal as valid parameter values) and gocuke.DocString or gocuke.DataTable as the last argument if this step uses a doc string or data table respectively. Custom step definitions will always take priority of auto-discovered step definitions.
type TestingT ¶
type TestingT interface {
Error(args ...any)
Errorf(format string, args ...any)
Fail()
FailNow()
Failed() bool
Fatal(args ...any)
Fatalf(format string, args ...any)
Log(args ...any)
Logf(format string, args ...any)
Skip(args ...any)
SkipNow()
Skipf(format string, args ...any)
Helper()
}
TestingT is the common subset of testing methods exposed to test suite instances and expected by common assertion and mocking libraries.