Documentation ¶
Overview ¶
Package option customizes how tests are run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modifier ¶
type Modifier interface {
// contains filtered or unexported methods
}
Modifier modifies an Option.
It is not intended to be implemented by code outside this package. It is created to provide the flexibility to pass more things to option.New in the future without the need to update its signature.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option customizes how tests are run.
If a testing function needs special customizations other than the ones specified in Option, we can use composition to extend it. For example, to test login functionality, we may create a struct named LoginOption that embeds Option and contains additional fields like Username and Password.
func New ¶
New does some sanity checks on the arguments before initializing an Option.
subject specifies the subject to be tested. It is intentionally not designed as an (optional) Modifier because it must contain at least one element. Essentially it is used as a prefix when invoking all the binaries during testing.
For example, if subject is ["foo", "bar"], then to test pulling a image, the command name would be "foo", and the command args would be something like ["bar", "pull", "alpine"].