(t *testing.T)
| 269 | } |
| 270 | |
| 271 | func TestResponseWriterStatusCode(t *testing.T) { |
| 272 | testWriter := httptest.NewRecorder() |
| 273 | writer := &responseWriter{} |
| 274 | writer.reset(testWriter) |
| 275 | w := ResponseWriter(writer) |
| 276 | |
| 277 | w.WriteHeader(http.StatusOK) |
| 278 | w.WriteHeaderNow() |
| 279 | |
| 280 | assert.Equal(t, http.StatusOK, w.Status()) |
| 281 | assert.True(t, w.Written()) |
| 282 | |
| 283 | w.WriteHeader(http.StatusUnauthorized) |
| 284 | |
| 285 | // status must be 200 although we tried to change it |
| 286 | assert.Equal(t, http.StatusOK, w.Status()) |
| 287 | } |
| 288 | |
| 289 | // mockPusherResponseWriter is an http.ResponseWriter that implements http.Pusher. |
| 290 | type mockPusherResponseWriter struct { |
nothing calls this directly
no test coverage detected