Created
January 3, 2012 23:38
-
-
Save 3den/1557591 to your computer and use it in GitHub Desktop.
add VRC to all remote calls automatically
This file contains 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
RSpec.configure do |config| | |
# Add VCR to all tests | |
config.around(:each) do |example| | |
name = example.metadata[:full_description].split(/\s+/, 2).join("/").underscore.gsub(/[^\w\/]+/, "_") | |
options = example.metadata[:vcr] || {} | |
VCR.use_cassette(name, options, &example) | |
end | |
end |
Hmm...allow_http_connections_when_no_cassette = false
(which is the default, BTW) should make it so that you get an exception anytime an HTTP request is made when there is no cassette. Do you get the error?
The problem is that the error message is:
TypeError:
can't convert String into Integer
This is hard to debug and I had to puts
the remote call to see the real error
That's a VCR bug we should fix then. Can you file an issue on the VCR issue tracker? It would be really helpful to have the backtrace and a small reproducible example (or access to a project that triggers this error). I've not gotten that error before so your code must be exercising some edge case that mine is not.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my config is: