Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Suite ¶
type Suite struct {
// Path is the filepath to the test suite directory.
Path string `yaml:"-"`
// Name is the short name for the test suite. If empty, defaults to Path.
Name string `yaml:"name,omitempty"`
// Description is a description of the tests contained in the test suite.
Description string `yaml:"description,omitempty"`
// Defaults contains any default configuration values for test cases
// contained within the test suite.
//
// During parsing, plugins are handed this raw data and asked to interpret
// it into known configuration values for that plugin.
Defaults map[string]interface{} `yaml:"defaults,omitempty"`
// Require specifies an ordered list of fixtures the test suite's test
// cases depends on.
Require []string `yaml:"require,omitempty"`
// Scenarios is a collection of test scenarios in this test suite
Scenarios []*scenario.Scenario `yaml:"-"`
}
Suite contains zero or more scenarios, one for each YAML file representing a Scenario in a given directory
func FromDir ¶
func FromDir( dirPath string, mods ...SuiteModifier, ) (*Suite, error)
FromDir reads the supplied directory path and returns a Suite representing the suite of test scenarios in that directory.
func FromScenario ¶ added in v1.1.0
FromScenario encapsulates a given scenario in a fresh suite and returns it.
type SuiteModifier ¶
type SuiteModifier func(s *Suite)
SuiteModifier sets some value on the test suite
func WithDefaults ¶
func WithDefaults(defaults map[string]interface{}) SuiteModifier
WithDefaults sets a test suite's Defaults attribute
func WithDescription ¶
func WithDescription(description string) SuiteModifier
WithDescription sets a test suite's Description attribute
func WithName ¶
func WithName(name string) SuiteModifier
WithName sets a test suite's Name attribute
func WithPath ¶
func WithPath(path string) SuiteModifier
WithPath sets a test suite's Path attribute
func WithRequires ¶
func WithRequires(require []string) SuiteModifier
WithRequires sets a test suite's Requires attribute
Click to show internal directories.
Click to hide internal directories.