Documentation ¶
Index ¶
- func ResolveStack(skip int) []string
- type Assertion
- func (a *Assertion) Eql(dst interface{}, messages ...interface{})
- func (a *Assertion) Equal(dst interface{}, messages ...interface{})
- func (a *Assertion) IsFalse(messages ...interface{})
- func (a *Assertion) IsNil(messages ...interface{})
- func (a *Assertion) IsNotNil(messages ...interface{})
- func (a *Assertion) IsNotZero(messages ...interface{})
- func (a *Assertion) IsTrue(messages ...interface{})
- func (a *Assertion) IsZero(messages ...interface{})
- type Describe
- type DetailedReporter
- func (r *DetailedReporter) Begin()
- func (r *DetailedReporter) BeginDescribe(name string)
- func (r *DetailedReporter) End()
- func (r *DetailedReporter) EndDescribe()
- func (r *DetailedReporter) Failure(failure *Failure)
- func (r *DetailedReporter) ItFailed(name string)
- func (r *DetailedReporter) ItIsExcluded(name string)
- func (r *DetailedReporter) ItIsPending(name string)
- func (r *DetailedReporter) ItPassed(name string)
- func (r *DetailedReporter) ItTook(duration time.Duration)
- func (r *DetailedReporter) SetTextFancier(f TextFancier)
- type Done
- type Failure
- type G
- func (g *G) After(h func())
- func (g *G) AfterEach(h func())
- func (g *G) Assert(src interface{}) *Assertion
- func (g *G) Before(h func())
- func (g *G) BeforeEach(h func())
- func (g *G) Describe(name string, h func())
- func (g *G) Errorf(format string, args ...interface{})
- func (g *G) Fail(error interface{})
- func (g *G) FailNow()
- func (g *G) Failf(format string, args ...interface{})
- func (g *G) Fatalf(format string, args ...interface{})
- func (g *G) Helper()
- func (g *G) It(name string, h ...interface{})
- func (g *G) JustBeforeEach(h func())
- func (g *G) SetReporter(r Reporter)
- func (g *G) Timeout(time time.Duration)
- func (g *G) Xit(name string, h ...interface{})
- type It
- type Itable
- type Monochrome
- func (self *Monochrome) Cyan(text string) string
- func (self *Monochrome) Gray(text string) string
- func (self *Monochrome) Green(text string) string
- func (self *Monochrome) Red(text string) string
- func (self *Monochrome) WithCheck(text string) string
- func (self *Monochrome) Yellow(text string) string
- type Reporter
- type Runnable
- type TerminalFancier
- func (self *TerminalFancier) Cyan(text string) string
- func (self *TerminalFancier) Gray(text string) string
- func (self *TerminalFancier) Green(text string) string
- func (self *TerminalFancier) Red(text string) string
- func (self *TerminalFancier) WithCheck(text string) string
- func (self *TerminalFancier) Yellow(text string) string
- type TextFancier
- type Xit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveStack ¶
Types ¶
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
Assertion represents a fact stated about a source object. It contains the source object and function to call
func (*Assertion) Eql ¶
func (a *Assertion) Eql(dst interface{}, messages ...interface{})
Eql is a shorthand alias of Equal for convenience
func (*Assertion) Equal ¶
func (a *Assertion) Equal(dst interface{}, messages ...interface{})
Equal takes a destination object and asserts that a source object and destination object are equal to one another. It will fail the assertion and print a corresponding message if the objects are not equivalent.
func (*Assertion) IsFalse ¶
func (a *Assertion) IsFalse(messages ...interface{})
IsFalse asserts that a source is equal to false. Optional messages can be provided for inclusion in the displayed message if the assertion fails. It will fail the assertion if the source does not resolve to false.
func (*Assertion) IsNil ¶
func (a *Assertion) IsNil(messages ...interface{})
IsNil asserts that source is nil.
func (*Assertion) IsNotNil ¶
func (a *Assertion) IsNotNil(messages ...interface{})
IsNotNil asserts that source is not nil.
func (*Assertion) IsNotZero ¶
func (a *Assertion) IsNotZero(messages ...interface{})
IsNotZero asserts the contrary of IsZero.
func (*Assertion) IsTrue ¶
func (a *Assertion) IsTrue(messages ...interface{})
IsTrue asserts that a source is equal to true. Optional messages can be provided for inclusion in the displayed message if the assertion fails. It will fail the assertion if the source does not resolve to true.
func (*Assertion) IsZero ¶
func (a *Assertion) IsZero(messages ...interface{})
IsZero asserts that source is a zero value for its respective type. If it is a structure, for example, all of its fields must have their respective zero value: "" for strings, 0 for int, etc. Slices, arrays and maps are only considered zero if they are nil. To check if these type of values are empty or not, use the len() from the data source with IsZero(). Example: g.Assert(len(list)).IsZero().
type DetailedReporter ¶
type DetailedReporter struct {
// contains filtered or unexported fields
}
func (*DetailedReporter) Begin ¶
func (r *DetailedReporter) Begin()
func (*DetailedReporter) BeginDescribe ¶
func (r *DetailedReporter) BeginDescribe(name string)
func (*DetailedReporter) End ¶
func (r *DetailedReporter) End()
func (*DetailedReporter) EndDescribe ¶
func (r *DetailedReporter) EndDescribe()
func (*DetailedReporter) Failure ¶
func (r *DetailedReporter) Failure(failure *Failure)
func (*DetailedReporter) ItFailed ¶
func (r *DetailedReporter) ItFailed(name string)
func (*DetailedReporter) ItIsExcluded ¶
func (r *DetailedReporter) ItIsExcluded(name string)
func (*DetailedReporter) ItIsPending ¶
func (r *DetailedReporter) ItIsPending(name string)
func (*DetailedReporter) ItPassed ¶
func (r *DetailedReporter) ItPassed(name string)
func (*DetailedReporter) ItTook ¶
func (r *DetailedReporter) ItTook(duration time.Duration)
func (*DetailedReporter) SetTextFancier ¶
func (r *DetailedReporter) SetTextFancier(f TextFancier)
type G ¶
type G struct {
// contains filtered or unexported fields
}
func (*G) BeforeEach ¶
func (g *G) BeforeEach(h func())
func (*G) JustBeforeEach ¶
func (g *G) JustBeforeEach(h func())
func (*G) SetReporter ¶
type Monochrome ¶
type Monochrome struct { }
func (*Monochrome) Cyan ¶
func (self *Monochrome) Cyan(text string) string
func (*Monochrome) Gray ¶
func (self *Monochrome) Gray(text string) string
func (*Monochrome) Green ¶
func (self *Monochrome) Green(text string) string
func (*Monochrome) Red ¶
func (self *Monochrome) Red(text string) string
func (*Monochrome) WithCheck ¶
func (self *Monochrome) WithCheck(text string) string
func (*Monochrome) Yellow ¶
func (self *Monochrome) Yellow(text string) string
type TerminalFancier ¶
type TerminalFancier struct { }
func (*TerminalFancier) Cyan ¶
func (self *TerminalFancier) Cyan(text string) string
func (*TerminalFancier) Gray ¶
func (self *TerminalFancier) Gray(text string) string
func (*TerminalFancier) Green ¶
func (self *TerminalFancier) Green(text string) string
func (*TerminalFancier) Red ¶
func (self *TerminalFancier) Red(text string) string
func (*TerminalFancier) WithCheck ¶
func (self *TerminalFancier) WithCheck(text string) string
func (*TerminalFancier) Yellow ¶
func (self *TerminalFancier) Yellow(text string) string