Commit Graph

7 Commits

Author SHA1 Message Date
pancho horrillo
2d5743af84 Add blank line between legal header and package declaration
Otherwise, the legal header is rendered as package documentation.
2019-11-13 18:18:44 +01:00
Héctor Hurtado
723e4787b3 Added legal header to all Go source files 2019-10-23 13:35:01 +02:00
pancho horrillo
7ba54b32b3 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.
2019-10-08 05:28:29 +02:00
pancho horrillo
0b056f6cf0 internal/client/{get,set}_test.go: send io.Writer() based on []byte
* internal/client/get_test.go:
  - Revert changes when setting the Body of the mock (gock).
  - Revert over-eager line splitting.

* internal/client/set_test.go:
  - Use bytes.NewReader([]byte("200")) instead of strings.NewReader("200")

Thanks to @nilp0inter for the feedback!
2019-10-06 11:34:15 +02:00
pancho horrillo
f98784088d Normalize internal/client/*_test.go
* Adjust test style for easy reading, by using literals instead of vars
* Move comparison to the `bytes` domain, instead of `string`
* Simplify testing code by using bytes.Buffer directly
* More consistent naming of variables and dummies (HANDLE_{FOO,BAR,BAD})
* Consistent testing style of gock.IsDone()
* Stick to 80-column
2019-10-06 09:41:12 +02:00
Héctor Hurtado
6b34047d75 Added gock.IsDone() to route list and remove tests. Remove content type in route remove command. Removed disturbing data for texts. Remove unneeded test in set command. 2019-10-04 13:55:36 +02:00
pancho horrillo
23128026c7 Rework directory structure
Co-authored-by: Héctor Hurtado <hector.hurtado@bbva.com>
2019-10-03 12:05:53 +02:00