suborbital / vektor

Opinionated production-grade HTTP server framework for Go
Apache License 2.0
82 stars 8 forks source link

vTest: add additional helpful methods to response.go #72

Open MacklinEngineering opened 2 years ago

MacklinEngineering commented 2 years ago

A place for us to add thoughts on which methods we might want to implement into response.go!

danielledeleo commented 2 years ago

Generic methods that take user provided funcs and validates with them. The signature might look something like:

func (r *Response) AssertBodyStringFunc(func(body, val string) bool, val string) *Response
func (r *Response) AssertBodyStringsFunc(func(body, val string) bool, vals []string) *Response