Documentation
¶
Overview ¶
Package gounit implements xunit for Go (along with some other goodies).
http://en.wikipedia.org/wiki/XUnit
(No attempt has yet been made to produce XUnit-style XML output.)
Index ¶
- Variables
- type A
- type Fixture
- func (self *Fixture) FocusGoTest(description string, action func(func()))
- func (self *Fixture) FocusTest(description string, action func())
- func (self *Fixture) GoTest(description string, action func(func()))
- func (self *Fixture) Log(args ...interface{})
- func (self *Fixture) Logf(message string, args ...interface{})
- func (self *Fixture) Run()
- func (self *Fixture) Setup(action func())
- func (self *Fixture) SkipGoTest(description string, action func(func()))
- func (self *Fixture) SkipSo(description string, actual interface{}, ...)
- func (self *Fixture) SkipTest(description string, action func())
- func (self *Fixture) So(description string, actual interface{}, ...)
- func (self *Fixture) Teardown(action func())
- func (self *Fixture) Test(description string, action func())
- type T
Constants ¶
This section is empty.
Variables ¶
var ( So = assertions.So ShouldEqual = assertions.ShouldEqual ShouldNotEqual = assertions.ShouldNotEqual ShouldAlmostEqual = assertions.ShouldAlmostEqual ShouldNotAlmostEqual = assertions.ShouldNotAlmostEqual ShouldResemble = assertions.ShouldResemble ShouldNotResemble = assertions.ShouldNotResemble ShouldPointTo = assertions.ShouldPointTo ShouldNotPointTo = assertions.ShouldNotPointTo ShouldBeNil = assertions.ShouldBeNil ShouldNotBeNil = assertions.ShouldNotBeNil ShouldBeTrue = assertions.ShouldBeTrue ShouldBeFalse = assertions.ShouldBeFalse ShouldBeZeroValue = assertions.ShouldBeZeroValue ShouldBeGreaterThan = assertions.ShouldBeGreaterThan ShouldBeGreaterThanOrEqualTo = assertions.ShouldBeGreaterThanOrEqualTo ShouldBeLessThan = assertions.ShouldBeLessThan ShouldBeLessThanOrEqualTo = assertions.ShouldBeLessThanOrEqualTo ShouldBeBetween = assertions.ShouldBeBetween ShouldNotBeBetween = assertions.ShouldNotBeBetween ShouldBeBetweenOrEqual = assertions.ShouldBeBetweenOrEqual ShouldNotBeBetweenOrEqual = assertions.ShouldNotBeBetweenOrEqual ShouldContain = assertions.ShouldContain ShouldNotContain = assertions.ShouldNotContain ShouldBeIn = assertions.ShouldBeIn ShouldNotBeIn = assertions.ShouldNotBeIn ShouldBeEmpty = assertions.ShouldBeEmpty ShouldNotBeEmpty = assertions.ShouldNotBeEmpty ShouldStartWith = assertions.ShouldStartWith ShouldNotStartWith = assertions.ShouldNotStartWith ShouldEndWith = assertions.ShouldEndWith ShouldNotEndWith = assertions.ShouldNotEndWith ShouldBeBlank = assertions.ShouldBeBlank ShouldNotBeBlank = assertions.ShouldNotBeBlank ShouldContainSubstring = assertions.ShouldContainSubstring ShouldNotContainSubstring = assertions.ShouldNotContainSubstring ShouldPanic = assertions.ShouldPanic ShouldNotPanic = assertions.ShouldNotPanic ShouldPanicWith = assertions.ShouldPanicWith ShouldNotPanicWith = assertions.ShouldNotPanicWith ShouldHaveSameTypeAs = assertions.ShouldHaveSameTypeAs ShouldNotHaveSameTypeAs = assertions.ShouldNotHaveSameTypeAs ShouldImplement = assertions.ShouldImplement ShouldNotImplement = assertions.ShouldNotImplement ShouldHappenBefore = assertions.ShouldHappenBefore ShouldHappenOnOrBefore = assertions.ShouldHappenOnOrBefore ShouldHappenAfter = assertions.ShouldHappenAfter ShouldHappenOnOrAfter = assertions.ShouldHappenOnOrAfter ShouldHappenBetween = assertions.ShouldHappenBetween ShouldHappenOnOrBetween = assertions.ShouldHappenOnOrBetween ShouldNotHappenOnOrBetween = assertions.ShouldNotHappenOnOrBetween ShouldHappenWithin = assertions.ShouldHappenWithin ShouldNotHappenWithin = assertions.ShouldNotHappenWithin ShouldBeChronological = assertions.ShouldBeChronological )
Functions ¶
This section is empty.
Types ¶
type A ¶
type A func( description string, actual interface{}, so func(actual interface{}, expected ...interface{}) string, expected ...interface{}, )
A represents an abbreviation of the function signatures implemented by the functions in `github.com/smartystreets/goconvey/convey/assertions`.
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
A simple xunit-style test fixture. Call NewFixture to create one.
func NewFixture ¶
NewFixture creates a new test fixture. Now you can call the attached methods to register and run test cases and optional setup and teardown functions. Because these methods return their receiver you have the option to chain the method calls if you like that sort of thing (I know I do).
func SkipNewFixture ¶
func (*Fixture) FocusGoTest ¶
FocusGoTest registers a test to be run instead of any other tests not registered with this function. It is analogous to FocusTest and is meant for concurrent scenarios. A call of this function is meant to aid debugging and development and should be replaced with a call to the Test function as soon as possible.
func (*Fixture) FocusTest ¶
FocusTest registers a test to be run instead of any other tests not registered with this function. A call of this function is meant to aid debugging and development and should be replaced with a call to the Test function as soon as possible.
func (*Fixture) GoTest ¶
GoTest registers a test case, to be run after any registered setup and before any registered teardown. Use GoTest in favor of the Test function when your action launches another goroutine, thus relenting flow of execution from your code back to this library. To avoid the teardown or additional test cases running away before your code finishes, call the done func() passed into the action as its last instruction. Test cases must have unique descriptions within the context of a Fixture.
func (*Fixture) Run ¶
func (self *Fixture) Run()
Run iterates all test cases performing the following steps: - If registered, run the setup function. - Run the test case. - If registered, run the teardown function.
func (*Fixture) Setup ¶
func (self *Fixture) Setup(action func())
Setup registers a function to be run before any and all test cases. Subsequent calls to this function overwrite the previously registered setup function.
func (*Fixture) SkipGoTest ¶
SkipGoTest registers a test case to be logged in test output but it will not be executed. It is analogous to SkipTest and is meant for concurrent scenarios. A call of this function is meant to aid debugging and development and should be replaced with a call to the Test function as soon as possible.
func (*Fixture) SkipTest ¶
SkipTest registers a test case to be logged in test output but it will not be executed. A call of this function is meant to aid debugging and development and should be replaced with a call to the Test function as soon as possible.
func (*Fixture) So ¶
func (self *Fixture) So(description string, actual interface{}, so func(actual interface{}, expected ...interface{}) string, expected ...interface{})
This method stands in as a 'So' call with a required description-- (a-la-`github.com/smartystreets/goconvey/convey/assertions.So`)