1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-27 22:38:25 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-04-02 14:19:39 -07:00
parent be5148ae27
commit b5d6c05101
22 changed files with 266 additions and 300 deletions

View File

@@ -13,10 +13,10 @@ func TestAddTrailingSlash(t *testing.T) {
rq := test.NewRequest(echo.GET, "/add-slash", nil)
rc := test.NewResponseRecorder()
c := echo.NewContext(rq, rc, e)
h := AddTrailingSlash()(echo.HandlerFunc(func(c echo.Context) error {
h := AddTrailingSlash()(func(c echo.Context) error {
return nil
}))
h.Handle(c)
})
h(c)
assert.Equal(t, "/add-slash/", rq.URL().Path())
}
@@ -25,9 +25,9 @@ func TestRemoveTrailingSlash(t *testing.T) {
rq := test.NewRequest(echo.GET, "/remove-slash/", nil)
rc := test.NewResponseRecorder()
c := echo.NewContext(rq, rc, e)
h := RemoveTrailingSlash()(echo.HandlerFunc(func(c echo.Context) error {
h := RemoveTrailingSlash()(func(c echo.Context) error {
return nil
}))
h.Handle(c)
})
h(c)
assert.Equal(t, "/remove-slash", rq.URL().Path())
}