Documentation ¶
Overview ¶
Oh the stack trace scanning! The density of comments in this file is evidence that the code doesn't exactly explain itself. Tread with care...
Package convey contains all of the public-facing entry points to this project. This means that it should never be required of the user to import any other packages from this project as they serve internal purposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( 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 ShouldContain = assertions.ShouldContain ShouldNotContain = assertions.ShouldNotContain ShouldBeIn = assertions.ShouldBeIn ShouldNotBeIn = assertions.ShouldNotBeIn 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 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 ¶
func Convey ¶
func Convey(items ...interface{})
Convey is the method intended for use when declaring the scopes of a specification. Each scope has a description and a func() which may contain other calls to Convey(), Reset() or Should-style assertions. Convey calls can be nested as far as you see fit.
IMPORTANT NOTE: The top-level Convey() within a Test method must conform to the following signature:
Convey(description string, t *testing.T, action func())
All other calls should like like this (no need to pass in *testing.T):
Convey(description string, action func())
Don't worry, the goconvey will panic if you get it wrong so you can fix it.
See the examples package for, well, examples.
func FocusConvey ¶
func FocusConvey(items ...interface{})
FocusConvey is has the inverse effect of SkipConvey. If the top-level Convey is changed to `FocusConvey`, only nested scopes that are defined with FocusConvey will be run. The rest will be ignored completely. This is handy when debugging a large suite that runs a misbehaving function repeatedly as you can disable all but one of that function without swaths of `SkipConvey` calls, just a targeted chain of calls to FocusConvey.
func Reset ¶
func Reset(action func())
Reset registers a cleanup function to be run after each Convey() in the same scope. See the examples package for a simple use case.
func SkipConvey ¶
func SkipConvey(items ...interface{})
SkipConvey is analagous to Convey except that the scope is not executed (which means that child scopes defined within this scope are not run either). The reporter will be notified that this step was skipped.
func SkipSo ¶
func SkipSo(stuff ...interface{})
SkipSo is analagous to So except that the assertion that would have been passed to So is not executed and the reporter is notified that the assertion was skipped.
func So ¶
func So(actual interface{}, assert assertion, expected ...interface{})
So is the means by which assertions are made against the system under test. The majority of exported names in the assertions package begin with the word 'Should' and describe how the first argument (actual) should compare with any of the final (expected) arguments. How many final arguments are accepted depends on the particular assertion that is passed in as the assert argument. See the examples package for use cases and the assertions package for documentation on specific assertion methods.
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method.
|
Package assertions contains the implementations for all assertions which are referenced in the convey package for use with the So(...) method. |
Package gotest contains internal functionality.
|
Package gotest contains internal functionality. |
Package reporting contains internal functionality related to console reporting and output.
|
Package reporting contains internal functionality related to console reporting and output. |