Skip to content
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

Allow regular expression URI matching from a JSON recording #24

Closed
wants to merge 3 commits into from

Conversation

epologee
Copy link
Contributor

@epologee epologee commented Oct 9, 2014

As described in /issues/23, my server's API uses time-based hashes in the URI, which breaks the recoring-lookup by VCR.

Because the URI structure is always the same, with merely the hash changing, I wanted to propose allowing regular expression matches in the recorded JSON files to get VCR to work with expected changes in the URI.

I've added three test methods to cover the added behavior, without breaking the existing one.

Is this something you'd consider merging, @dstnbrkr?

@dstnbrkr
Copy link
Owner

dstnbrkr commented Oct 9, 2014

Great feature! Couple comments inline.

}];
}

return recording;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a field other than 'uri' for regex matchers? If we can do that, then we keep the regexes out of the responseDictionary (good since they'll never be a valid key) and we only enumerate the regexes.

@dstnbrkr
Copy link
Owner

@epologee definitely interested in merging this, wdyt of differentiating between url and regex matchers (inline comment above)?

@epologee
Copy link
Contributor Author

Cool! Your comments are valid. Just haven't gotten around to it. Will try
this weekend. Any ideas for the name of the regex attribute in the JSON
recording?

@dstnbrkr
Copy link
Owner

Awesome - maybe uri-regex for that parameter? No strong opinions though.

@dstnbrkr
Copy link
Owner

closing as stale

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

Successfully merging this pull request may close these issues.

2 participants