gin/test_helpers.go

15 lines
234 B
Go
Raw Normal View History

2015-06-02 20:16:51 +00:00
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
}