Documentation ¶
Overview ¶
Package asshat provides common ResponseAssertions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyEqual ¶
func BodyEqual(expects []byte) hat.ResponseAssertion
BodyEqual checks if the response body equals expects. Use BodyStringEqual instead of casting `expects` from a string so the error message shows the textual difference.
func BodyMatches ¶
func BodyMatches(expr string) hat.ResponseAssertion
BodyMatches ensures the response body matches the regex described by expr.
func BodyStringEqual ¶
func BodyStringEqual(expects string) hat.ResponseAssertion
BodyStringEqual checks if the body equals string expects.
func HeaderEqual ¶
func HeaderEqual(header, expected string) hat.ResponseAssertion
HeaderEqual checks that the provided header key and value are present in the response.
func StatusEqual ¶
func StatusEqual(expected int) hat.ResponseAssertion
StatusEqual ensures the response status equals expected.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.