generator

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: BSD-3-Clause Imports: 10 Imported by: 3

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

type OutputListener interface {
	Notify(testFilePath string, contentType string, output io.Reader)
}

OutputListener is the interface of things that want to be notified about generated content.

type PageData

type PageData struct {
	Title       string
	TestResults map[string]TestData
}

PageData is the struct that populates the template with data from the test output.

func NewPageData added in v1.2.0

func NewPageData(title string, someMap *base.SomeMap) (pageData PageData)

NewPageData holds the title and the test results

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

func NewTestData(some *base.Some) (testData TestData)

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

type TestResult struct {
	TestID     string
	Failed     bool
	Skipped    bool
	TestOutput string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL