v1.1.0
New features:
- tell the user about possible mistakes concerning the mocked HTTP method;
- by default, registering a
Responderfor a lower-cased method amongCONNECT,DELETE,GET,HEAD,OPTIONS,POST,PUTandTRACE, produces a panic as it is probably a mistake. This behavior can be disabled by setting newMockTransport.DontCheckMethodfield totrueprior to theRegister*Responder*()call; - registering a
nilRespondernow unregisters it and zeroes its statistics; - add
Respondermethods:Delay(time.Duration)to delay a response,Then(Responder)to chain responders.
Fix:
- net/http and httpmock issued
Response.Bodyare now consistent. Now, the httpmock one can only be read once: if some code wrongly depends onNewStringResponse()&NewBytesResponse()response body be read ad infinitum, it should be changed to either recallNewStringResponse()&NewBytesResponse()before reading again the response body, or useNewStringResponder()&NewBytesResponder().
Doc:
- document that (re-)registering a
Responderzeroes its statistics.
Enjoy!