Exporting CreateTestContext

This commit is contained in:
danielalves
2015-06-02 17:16:51 -03:00
parent ce784498b4
commit f831ac80ac
2 changed files with 45 additions and 40 deletions
+14
View File
@@ -0,0 +1,14 @@
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
}