Documentation ¶
Overview ¶
Package testament provides convinience tools in testing.
AssertInError ¶
If you have a deeply nested error you want to check whether a particular error is in the haystack you can call this function. It will upwrap everything made from any of or any combination of fmt.Errorf, hashicorp/go-multierror, and pkg/errors helpers. It will fallback to the string representation of the error being in the haystack string representation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertInError ¶
AssertInError returns true if the needle is found in stack, which is created either with pkg/errors help, the multierror or Go's error wrap. It will fall back to checking the contents of the needle.Error() is in haystack.Error().
func AssertIsCode ¶ added in v0.1.0
AssertIsCode is a helper to assert the err error contains the code.
func GetFreeOpenPort ¶ added in v0.1.0
GetFreeOpenPort returns a port that is already claimed.
func GetFreePort ¶ added in v0.1.0
GetFreePort returns a random open port.
func RandomString ¶ added in v0.1.0
RandomString returns a randomly generated string with the length of count.
Types ¶
This section is empty.