Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OutputDirectory ¶ added in v1.4.0
func OutputDirectory() string
OutputDirectory finds the output dir in either one of the system env var $GOGIVENS_OUTPUT_DIR, the os tmp dir, or default to the current dir otherwise.
Types ¶
type FileOutputGenerator ¶ added in v1.4.0
type FileOutputGenerator struct {
OutputListener
}
FileOutputGenerator is a struct which implements the OutputListener interface
func (*FileOutputGenerator) Notify ¶ added in v1.4.0
func (f *FileOutputGenerator) Notify(testFilePath string, contentType string, output io.Reader)
Notify is called by Generator to pass the output content from the test. Output is an io.Reader, usually test output. The file is written to env var GOGIVENS_OUTPUT_DIR if set, or defaults either to system tmp or the current dir if neither are found.
type GoGivensOutputGenerator ¶
type GoGivensOutputGenerator interface { Generate(data PageData) (output io.Reader) //ContentType is text/html, application/json or other mime type ContentType() string }
GoGivensOutputGenerator is an interface that can be implemented by anything that can generate file content to be output after a test has completed.
type OutputListener ¶ added in v1.4.0
OutputListener is the interface of things that want to be notified about generated content.
type TestData ¶ added in v1.2.0
type TestData struct { TestResult TestResult TestTitle string InterestingGivens testdata.InterestingGivens CapturedIO testdata.CapturedIO ParsedTestContent base.ParsedTestContent }
TestData holds a copy of test results, interesting givens, captured io, and parsed test content (given/when/then)
func NewTestData ¶ added in v1.2.0
NewTestData creates a new copy of test results, interesting givens, captured io, and parsed test content (given/when/then)
type TestResult ¶ added in v1.2.0
TestResult holds the results of the test, whether it failed, was skipped, it's ID and the output from the Fail/Skip if appropriate
func NewTestResult ¶ added in v1.2.0
func NewTestResult(data *base.TestMetaData) TestResult
NewTestResult returns a copy of the test meta data