OCMock 3 #define andReturn(), as a result, calling andReturn() will return an error.#95
Open
patcheng wants to merge 2 commits intolausobo:masterfrom
Open
OCMock 3 #define andReturn(), as a result, calling andReturn() will return an error.#95patcheng wants to merge 2 commits intolausobo:masterfrom
patcheng wants to merge 2 commits intolausobo:masterfrom
Conversation
so, created an alias that OCMock is not touching Based on moneytree@f829174
|
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. |
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
so, created an alias that OCMock is not touching
Based on moneytree@f829174