Documentation ¶
Index ¶
- Variables
- func After(filter func())
- func Before(filter func())
- func Context(description string, callback func())
- func Describe(t *testing.T, description string, callback func())
- func Equal(values ...interface{}) (failureMessage string)
- func Exist(values ...interface{}) (failureMessage string)
- func It(message string, evaluator func())
- func NotEqual(values ...interface{}) (failureMessage string)
- func NotExist(values ...interface{}) (failureMessage string)
- type DocumentFormatter
- type DotFormatter
- type Example
- type ExampleGroup
- func (group *ExampleGroup) Ancestors() []*ExampleGroup
- func (group *ExampleGroup) PrintResult()
- func (group *ExampleGroup) ReverseAncestors() []*ExampleGroup
- func (group *ExampleGroup) ReverseAncestorsAndSelf() []*ExampleGroup
- func (group *ExampleGroup) Root() *ExampleGroup
- func (group *ExampleGroup) RunAfterFilters()
- func (group *ExampleGroup) RunBeforeFilters()
- type Expectation
- type Formatter
- type Matcher
Constants ¶
This section is empty.
Variables ¶
var Output = colorable.NewColorableStdout()
Functions ¶
func Equal ¶
func Equal(values ...interface{}) (failureMessage string)
Checks if actual == expected.
Types ¶
type DocumentFormatter ¶
type DocumentFormatter struct{}
func (*DocumentFormatter) Failed ¶
func (formatter *DocumentFormatter) Failed(example *Example, message string)
func (*DocumentFormatter) Started ¶
func (formatter *DocumentFormatter) Started(example *Example)
func (*DocumentFormatter) Succeeded ¶
func (formatter *DocumentFormatter) Succeeded(example *Example)
type DotFormatter ¶
type DotFormatter struct{}
func (*DotFormatter) Failed ¶
func (formatter *DotFormatter) Failed(example *Example, message string)
func (*DotFormatter) Started ¶
func (formatter *DotFormatter) Started(example *Example)
Does nothing.
func (*DotFormatter) Succeeded ¶
func (formatter *DotFormatter) Succeeded(example *Example)
type Example ¶
type Example struct { *ExampleGroup Message string Evaluator func() HasFailure bool Formatter }
func It() creates a new Example object.
func (*Example) Descriptions ¶
Returns its ExamplesGroups' descriptions as an array of string.
func (*Example) FullDescription ¶
Returns its entire descriptions + message as a string.
type ExampleGroup ¶
type ExampleGroup struct { *testing.T Parent *ExampleGroup Description string Result string BeforeFilters []func() AfterFilters []func() }
Describe or Context creates this object.
func (*ExampleGroup) Ancestors ¶
func (group *ExampleGroup) Ancestors() []*ExampleGroup
Returns its ancestor ExampleGroups in ascending order according to distance.
func (*ExampleGroup) PrintResult ¶
func (group *ExampleGroup) PrintResult()
In non-verbose mode, we print test results for each Describe.
func (*ExampleGroup) ReverseAncestors ¶
func (group *ExampleGroup) ReverseAncestors() []*ExampleGroup
Returns its ancestor ExampleGroups in descending order according to distance.
func (*ExampleGroup) ReverseAncestorsAndSelf ¶
func (group *ExampleGroup) ReverseAncestorsAndSelf() []*ExampleGroup
Merges its ancestors and itself.
func (*ExampleGroup) Root ¶
func (group *ExampleGroup) Root() *ExampleGroup
Gets root ExampleGroup defined by Describe func.
func (*ExampleGroup) RunAfterFilters ¶
func (group *ExampleGroup) RunAfterFilters()
Runs all AfterFilters defined to its ancestors and itself.
func (*ExampleGroup) RunBeforeFilters ¶
func (group *ExampleGroup) RunBeforeFilters()
Runs all BeforeFilters defined to its ancestors and itself.
type Expectation ¶
type Expectation struct { *Example Actual interface{} }
func Expect() creates a new Expectation object.
func Expect ¶
func Expect(actual interface{}) *Expectation
func (*Expectation) To ¶
func (expectation *Expectation) To(matcher Matcher, expected ...interface{})
Checks if a given matcher satisfies actual & optional values.