asshat

package
v0.0.0-...-222976f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL