1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Merge pull request #201 from syntaqx/master

Adding Response.Committed Getter
This commit is contained in:
Vishal Rana 2015-09-13 09:48:28 -07:00
commit 71ae409ea7
2 changed files with 9 additions and 1 deletions

View File

@ -74,6 +74,10 @@ func (r *Response) Size() int64 {
return r.size
}
func (r *Response) Committed() bool {
return r.committed
}
func (r *Response) reset(w http.ResponseWriter) {
r.writer = w
r.size = 0

View File

@ -1,10 +1,11 @@
package echo
import (
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
func TestResponse(t *testing.T) {
@ -46,6 +47,9 @@ func TestResponse(t *testing.T) {
// Size
assert.EqualValues(t, len(s), r.Size())
// Committed
assert.Equal(t, true, r.Committed())
// Hijack
assert.Panics(t, func() {
r.Hijack()