AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 601 forks source link

containsAtLeastQueryParams: A matcher that checks only the target params #271

Closed crsantos closed 6 years ago

crsantos commented 6 years ago

Checklist

Description

This is my proposal for a matcher that checks ONLY the target parameters, and does not fail when more parameters are found. Just like containsAtLeastQueryParams, but it doesn't break when more parameters are found.

Motivation and Context

My motivation was that I need to stub a request but I didn't want to handle all the parameters, just 2 or 3. So , this matches at least the target parameters, and ignores the others, if there are more than the target ones, ignores them, validating only the passed ones.

I don't know if I should bump spec version, if not, please say so, so I can revert.

Thanks.

crsantos commented 6 years ago

allowMoreParams as a default param looks way better! I’ll update. Actually PR is closed but I’ll reopen soon when I finish all updates. Thanks for reviewing