Skip to content

Commit 6353e56

Browse files
This reverts commit 9d083ca.
1 parent 6561324 commit 6353e56

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

assert/http_assertions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, va
115115
func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values, body io.Reader) string {
116116
w := httptest.NewRecorder()
117117

118-
if values != nil {
119-
url = url + "?" + values.Encode()
118+
if values !=nil {
119+
url = url+"?"+values.Encode()
120120
}
121121
req, err := http.NewRequest(method, url, body)
122122
if err != nil {
@@ -136,7 +136,7 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string,
136136
if h, ok := t.(tHelper); ok {
137137
h.Helper()
138138
}
139-
httpBody := HTTPBody(handler, method, url, values, body)
139+
httpBody := HTTPBody(handler, method, url, values, body)
140140

141141
contains := strings.Contains(httpBody, fmt.Sprint(str))
142142
if !contains {

assert/http_assertions_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ func TestHttpBodyWrappers(t *testing.T) {
173173
assert := New(t)
174174
mockAssert := New(new(testing.T))
175175

176-
assert.True(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "Hello, World!"))
177-
assert.True(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "World"))
178-
assert.False(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "world"))
176+
assert.True(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil,"Hello, World!"))
177+
assert.True(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil,"World"))
178+
assert.False(mockAssert.HTTPBodyContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil,"world"))
179179

180180
assert.False(mockAssert.HTTPBodyNotContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "Hello, World!"))
181-
assert.False(mockAssert.HTTPBodyNotContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "World"))
182-
assert.True(mockAssert.HTTPBodyNotContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil, "world"))
181+
assert.False(mockAssert.HTTPBodyNotContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil,"World"))
182+
assert.True(mockAssert.HTTPBodyNotContains(httpGetHelloNameHandler, "GET", "/", url.Values{"name": []string{"World"}}, nil,"world"))
183183
}
184184

185185
func httpGetHelloNameHandler(w http.ResponseWriter, r *http.Request) {
@@ -195,4 +195,4 @@ func httpPostHandler(w http.ResponseWriter, r *http.Request) {
195195
}
196196

197197
w.Write(body)
198-
}
198+
}

0 commit comments

Comments
 (0)