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

Function HTTPBodyContains

require/require.go:676–684  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

674//
675// Returns whether the assertion was successful (true) or not (false).
676func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
677 if h, ok := t.(tHelper); ok {
678 h.Helper()
679 }
680 if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) {
681 return
682 }
683 t.FailNow()
684}
685
686// HTTPBodyContainsf asserts that a specified handler returns a
687// body that contains a string.

Callers 1

HTTPBodyContainsMethod · 0.70

Calls 3

HTTPBodyContainsFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected