8000 Support matching recordings using a URI regex by sjmadsen · Pull Request #31 · dstnbrkr/VCRURLConnection · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support matching recordings using a URI regex #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 4, 2016

Conversation

sjmadsen
Copy link
Contributor
@sjmadsen sjmadsen commented Aug 3, 2016

This PR revives the work that @epologee started in #24. I cherry picked his commits, then made additional changes to address the suggestions made by @dstnbrkr.

@dstnbrkr
Copy link
Owner
dstnbrkr commented Aug 4, 2016

Looks good - thanks for reviving. Those two equality unit tests are failing it seems.

@sjmadsen
Copy link
Contributor Author
sjmadsen commented Aug 4, 2016

I suspected there might be something wrong. The day job blocks Travis CI (who knows why).

Pretty sure the unit tests pass when I run it through Xcode, but I'll investigate and get a fix pushed up.

Regex-based recordings use a different key (“uri-regex”) from exact match recordings. When recordings are added to a cassette, those that match on a regex are stored in a separate array instead of the VCRRequestKey-based dictionary.

I’m keeping the regex in a separate property on VCRRecording, too, and it’s stored as an NSRegularExpression instance instead of NSString so we don’t have to rebuild the instances on every network request.
@dstnbrkr
Copy link
Owner
dstnbrkr commented Aug 4, 2016

Excellent! Thanks for adding this feature!

@dstnbrkr dstnbrkr merged commit 5579ef8 into dstnbrkr:master Aug 4, 2016
@epologee
Copy link
Contributor
epologee commented Aug 5, 2016

Thanks @sjmadsen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Non 45AE e yet
Development

Successfully merging this pull request may close these issues.

3 participants
0