1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-23 22:24:54 +02:00

Fixed test

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2018-08-28 20:49:22 -07:00
parent 31e795315a
commit 90822319eb

View File

@@ -60,12 +60,7 @@ func TestBodyDumpFails(t *testing.T) {
return errors.New("some error") return errors.New("some error")
} }
requestBody := "" mw := BodyDump(func(c echo.Context, reqBody, resBody []byte) {})
responseBody := ""
mw := BodyDump(func(c echo.Context, reqBody, resBody []byte) {
requestBody = string(reqBody)
responseBody = string(resBody)
})
if !assert.Error(t, mw(h)(c)) { if !assert.Error(t, mw(h)(c)) {
t.FailNow() t.FailNow()
@@ -84,8 +79,6 @@ func TestBodyDumpFails(t *testing.T) {
return true return true
}, },
Handler: func(c echo.Context, reqBody, resBody []byte) { Handler: func(c echo.Context, reqBody, resBody []byte) {
requestBody = string(reqBody)
responseBody = string(resBody)
}, },
}) })