MCPcopy
hub / github.com/stretchr/testify / HTTPBodyContains

Method HTTPBodyContains

require/require_forward.go:544–549  ·  view source on GitHub ↗

HTTPBodyContains asserts that a specified handler returns a body that contains a string. a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") Returns whether the assertion was successful (true) or not (false).

(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

542//
543// Returns whether the assertion was successful (true) or not (false).
544func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
545 if h, ok := a.t.(tHelper); ok {
546 h.Helper()
547 }
548 HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...)
549}
550
551// HTTPBodyContainsf asserts that a specified handler returns a
552// body that contains a string.

Callers

nothing calls this directly

Calls 2

HTTPBodyContainsFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected