Documentation
¶
Index ¶
- func AllKeys(expected ...interface{}) *gocrest.Matcher
- func FieldNamed(expected string) *gocrest.Matcher
- func FunctionNamed(expected string) *gocrest.Matcher
- func Key(expected interface{}) *gocrest.Matcher
- func Length(expected interface{}) *gocrest.Matcher
- func Prefix(expected string) *gocrest.Matcher
- func Suffix(expected string) *gocrest.Matcher
- func TypeName(expected interface{}) *gocrest.Matcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllKeys ¶
AllKeys is a matcher that checks if map actual has all keys == expecteds. Panics when actual's Kind is not a map. Returns a matcher that matches when a map has all keys == all expected.
func FieldNamed ¶
FieldNamed is a naive implementation for testing if a struct has a particular field name. Does not check type. Returns a matcher that will use reflect to check if the actual has the method given by expected
func FunctionNamed ¶
FunctionNamed implementation for testing if a Type has a particular method name. Does not check parameters. Returns a matcher that will use reflect to check if the actual has the method given by expected.
func Key ¶
Key is a matcher that checks if actual has a key == expected. Panics when actual's Kind is not a map. Returns a matcher that matches when a map has key == expected
func Length ¶
Length can be called with arrays, maps, *gocrest.Matcher and strings but not numeric types. has.Length(is.GreaterThan(x)) is a valid call. Returns a matcher that matches if the length matches the given criteria
func Prefix ¶
Prefix returns a matcher that matches if the given string is prefixed with the expected string Function panics if the actual is not a string. Uses strings.Prefix(act, exp) to evaluate strings. Returns a matcher that returns true if the above conditions are met
func Suffix ¶
Suffix returns a matcher that matches if the given string is suffixed with the expected string. Panics if the actual is not a string. Uses strings.Suffix(act,exp) to evaluate strings. Returns a matcher that returns true if the above conditions are met.
Types ¶
This section is empty.