mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 05:42:09 +08:00
Merge f900e7231fcd903fb37b93ca36d0032aa1fdaaab into 9177f01c2843b91820780197f521ba48554b9df3
This commit is contained in:
commit
b7a1f01d63
15
test_helpers_test.go
Normal file
15
test_helpers_test.go
Normal 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
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user