Merge f900e7231fcd903fb37b93ca36d0032aa1fdaaab into 9177f01c2843b91820780197f521ba48554b9df3

This commit is contained in:
Div Shekhar 2016-11-22 23:35:41 +00:00 committed by GitHub
commit b7a1f01d63

15
test_helpers_test.go Normal file
View File

@ -0,0 +1,15 @@
// This file' name ends with "_test" to avoid pushing "httptest" import on users.
package gin
import (
"net/http/httptest"
)
func CreateTestContext() (c *Context, w *httptest.ResponseRecorder, r *Engine) {
w = httptest.NewRecorder()
r = New()
c = r.allocateContext()
c.reset()
c.writermem.reset(w)
return
}