Revert to using strings for simplicity
It is safe in this case. * gock.BodyString(body string) coerces body into a []byte * client.SetData() eventually resolves to a call to http.Client.Do(), which handles the string gracefully as well.
This commit is contained in:
@@ -13,7 +13,7 @@ func TestWriteContentToWriter(t *testing.T) {
|
||||
gock.New("http://localhost").
|
||||
Get("/handlers/HANDLER_BAR/request/body").
|
||||
Reply(http.StatusOK).
|
||||
Body(bytes.NewReader([]byte("FOO")))
|
||||
BodyString("FOO")
|
||||
|
||||
var b bytes.Buffer
|
||||
err := GetData("http://localhost", "HANDLER_BAR", "/request/body", &b)
|
||||
|
||||
Reference in New Issue
Block a user