Documentation ¶
Index ¶
- func Because(t *testing.T, context string, wrapper func(*testing.T))
- func Log(args ...interface{})
- func When(t *testing.T, context string, wrapper func(*testing.T))
- type Comparer
- type HTTPClientMock
- type Mint
- type MintResult
- type Testee
- func (testee *Testee) Deeply() *Testee
- func (testee *Testee) Dry() *Testee
- func (testee *Testee) Exit(expectedCode int) MintResult
- func (testee *Testee) In(expecteds ...interface{}) MintResult
- func (testee *Testee) Log(args ...interface{})
- func (testee *Testee) Match(expression string) MintResult
- func (testee *Testee) Not() *Testee
- func (testee *Testee) Query(query string) *Testee
- func (testee *Testee) ToBe(expected interface{}) MintResult
- func (testee *Testee) TypeOf(typeName string) MintResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPClientMock ¶ added in v1.3.3
type Mint ¶
type Mint struct {
// contains filtered or unexported fields
}
Mint (mint.Mint) is wrapper for *testing.T blending testing type to omit repeated `t`.
type MintResult ¶ added in v1.4.0
type MintResult struct {
// contains filtered or unexported fields
}
MintResult provide the results of assertion for `Dry` option.
func (MintResult) Message ¶ added in v1.4.0
func (r MintResult) Message() string
Message returns failure message.
func (MintResult) NG ¶ added in v1.4.0
func (r MintResult) NG() bool
NG is the opposite alias for OK().
func (MintResult) OK ¶ added in v1.4.0
func (r MintResult) OK() bool
OK returns whether result is ok or not.
type Testee ¶
type Testee struct {
// contains filtered or unexported fields
}
Testee is holder of interfaces which user want to assert and also has its result.
func Require ¶ added in v1.4.0
Require provides "*mint.Testee", which stops execution of goroutine when the assertion failed.
func (*Testee) Deeply ¶
Deeply makes following assertions use `reflect.DeepEqual`. You had better use this to compare reference type objects.
func (*Testee) Dry ¶
Dry makes the testee NOT to call "Fail()". Use this if you want to fail test in a purpose.
func (*Testee) In ¶
func (testee *Testee) In(expecteds ...interface{}) MintResult
In can assert the testee is in given array.
func (*Testee) Log ¶
func (testee *Testee) Log(args ...interface{})
Log only output if -v flag is given. This is because the standard "t.Testing.Log" method decorates its caller: runtime.Caller(3) automatically.
func (*Testee) Match ¶
func (testee *Testee) Match(expression string) MintResult
Match can assert the testee to match with specified regular expression. It uses `regexp.MustCompile`, it's due to caller to make sure it's valid regexp. OS will exit with code 1, when the assertion fail. If you don't want to exit, see "Dry()".
func (*Testee) ToBe ¶
func (testee *Testee) ToBe(expected interface{}) MintResult
ToBe can assert the testee to equal the parameter of this func. OS will exit with code 1, when the assertion fail. If you don't want to exit, see "Dry()".
func (*Testee) TypeOf ¶
func (testee *Testee) TypeOf(typeName string) MintResult
TypeOf can assert the type of testee to equal the parameter of this func. OS will exit with code 1, when the assertion fail. If you don't want to exit, see "Dry()".