From beb879e4754af8d25b9f326c20d831e518ad645f Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 30 Sep 2019 16:22:12 +1000 Subject: [PATCH] Change Writter to Writer. (#2079) --- response_writer_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/response_writer_test.go b/response_writer_test.go index a5e111e5..1f113e74 100644 --- a/response_writer_test.go +++ b/response_writer_test.go @@ -29,38 +29,38 @@ func init() { } func TestResponseWriterReset(t *testing.T) { - testWritter := httptest.NewRecorder() + testWriter := httptest.NewRecorder() writer := &responseWriter{} var w ResponseWriter = writer - writer.reset(testWritter) + writer.reset(testWriter) assert.Equal(t, -1, writer.size) assert.Equal(t, http.StatusOK, writer.status) - assert.Equal(t, testWritter, writer.ResponseWriter) + assert.Equal(t, testWriter, writer.ResponseWriter) assert.Equal(t, -1, w.Size()) assert.Equal(t, http.StatusOK, w.Status()) assert.False(t, w.Written()) } func TestResponseWriterWriteHeader(t *testing.T) { - testWritter := httptest.NewRecorder() + testWriter := httptest.NewRecorder() writer := &responseWriter{} - writer.reset(testWritter) + writer.reset(testWriter) w := ResponseWriter(writer) w.WriteHeader(http.StatusMultipleChoices) assert.False(t, w.Written()) assert.Equal(t, http.StatusMultipleChoices, w.Status()) - assert.NotEqual(t, http.StatusMultipleChoices, testWritter.Code) + assert.NotEqual(t, http.StatusMultipleChoices, testWriter.Code) w.WriteHeader(-1) assert.Equal(t, http.StatusMultipleChoices, w.Status()) } func TestResponseWriterWriteHeadersNow(t *testing.T) { - testWritter := httptest.NewRecorder() + testWriter := httptest.NewRecorder() writer := &responseWriter{} - writer.reset(testWritter) + writer.reset(testWriter) w := ResponseWriter(writer) w.WriteHeader(http.StatusMultipleChoices) @@ -68,7 +68,7 @@ func TestResponseWriterWriteHeadersNow(t *testing.T) { assert.True(t, w.Written()) assert.Equal(t, 0, w.Size()) - assert.Equal(t, http.StatusMultipleChoices, testWritter.Code) + assert.Equal(t, http.StatusMultipleChoices, testWriter.Code) writer.size = 10 w.WriteHeaderNow() @@ -76,30 +76,30 @@ func TestResponseWriterWriteHeadersNow(t *testing.T) { } func TestResponseWriterWrite(t *testing.T) { - testWritter := httptest.NewRecorder() + testWriter := httptest.NewRecorder() writer := &responseWriter{} - writer.reset(testWritter) + writer.reset(testWriter) w := ResponseWriter(writer) n, err := w.Write([]byte("hola")) assert.Equal(t, 4, n) assert.Equal(t, 4, w.Size()) assert.Equal(t, http.StatusOK, w.Status()) - assert.Equal(t, http.StatusOK, testWritter.Code) - assert.Equal(t, "hola", testWritter.Body.String()) + assert.Equal(t, http.StatusOK, testWriter.Code) + assert.Equal(t, "hola", testWriter.Body.String()) assert.NoError(t, err) n, err = w.Write([]byte(" adios")) assert.Equal(t, 6, n) assert.Equal(t, 10, w.Size()) - assert.Equal(t, "hola adios", testWritter.Body.String()) + assert.Equal(t, "hola adios", testWriter.Body.String()) assert.NoError(t, err) } func TestResponseWriterHijack(t *testing.T) { - testWritter := httptest.NewRecorder() + testWriter := httptest.NewRecorder() writer := &responseWriter{} - writer.reset(testWritter) + writer.reset(testWriter) w := ResponseWriter(writer) assert.Panics(t, func() {