@@ -129,9 +129,9 @@ func (r *RequestBuilder) WithCookieNameValue(name, value string) *RequestBuilder
129129 return r .WithCookie (& http.Cookie {Name : name , Value : value })
130130}
131131
132- // This function performs the request, it takes a pointer to a testing context
133- // to print messages, and a pointer to an echo context for request handling.
134- func (r * RequestBuilder ) Go (t * testing.T , e * echo. Echo ) * CompletedRequest {
132+ // GoWithHTTPHandler performs the request, it takes a pointer to a testing context
133+ // to print messages, and a http handler for request handling.
134+ func (r * RequestBuilder ) GoWithHTTPHandler (t * testing.T , handler http. Handler ) * CompletedRequest {
135135 if r .Error != nil {
136136 // Fail the test if we had an error
137137 t .Errorf ("error constructing request: %s" , r .Error )
@@ -151,13 +151,19 @@ func (r *RequestBuilder) Go(t *testing.T, e *echo.Echo) *CompletedRequest {
151151 }
152152
153153 rec := httptest .NewRecorder ()
154- e .ServeHTTP (rec , req )
154+ handler .ServeHTTP (rec , req )
155155
156156 return & CompletedRequest {
157157 Recorder : rec ,
158158 }
159159}
160160
161+ // Go performs the request, it takes a pointer to a testing context
162+ // to print messages, and a pointer to an echo context for request handling.
163+ func (r * RequestBuilder ) Go (t * testing.T , e * echo.Echo ) * CompletedRequest {
164+ return r .GoWithHTTPHandler (t , e )
165+ }
166+
161167// This is the result of calling Go() on the request builder. We're wrapping the
162168// ResponseRecorder with some nice helper functions.
163169type CompletedRequest struct {
0 commit comments