(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestResponse_ChangeStatusCodeBeforeWrite(t *testing.T) { |
| 54 | e := New() |
| 55 | rec := httptest.NewRecorder() |
| 56 | res := NewResponse(rec, e.Logger) |
| 57 | |
| 58 | res.Before(func() { |
| 59 | if 200 < res.Status && res.Status < 300 { |
| 60 | res.Status = 200 |
| 61 | } |
| 62 | }) |
| 63 | |
| 64 | res.WriteHeader(209) |
| 65 | |
| 66 | assert.Equal(t, http.StatusOK, rec.Code) |
| 67 | } |
| 68 | |
| 69 | func TestResponse_Unwrap(t *testing.T) { |
| 70 | e := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…