OCMock 3 #define andReturn(), as a result, calling andReturn() will return an error.
so, created an alias that OCMock is not touching
Based on https://github.com/moneytree/Nocilla/commit/f8291740558f88abd8fee5250977b3cb3fcd610c
Some minor feedback on the API for the status code.
What do you think of calling it withStatusCode? It would fit in nicely with other DSL methods like withHeaders and withBody.
Just a thought. Thanks for opening a pull request on this. I was just about to start digging into the issue.
I think the "addReturn" separates withHeaders for the request, vs withHeaders for the response.
stubRequest(@"POST", @"https://api.example.com/dogs.json").
withHeaders(@{@"Accept": @"application/json", @"X-CUSTOM-HEADER": @"abcf2fbc6abgf"}).
withBody(@"^The body start with this".regex).
andReturnWithStatusCode(200).
withHeaders(@{@"Content-Type": @"application/json"});
vs
stubRequest(@"POST", @"https://api.example.com/dogs.json").
withHeaders(@{@"Accept": @"application/json", @"X-CUSTOM-HEADER": @"abcf2fbc6abgf"}).
withBody(@"^The body start with this".regex).
withStatusCode(200).
withHeaders(@{@"Content-Type": @"application/json"});
@luisobo ?
@patcheng good point, that does break it up nicely.
Any update on this pull request? Maybe @luisobo or @patcheng?