I have a very simple module
I'm testing with Ruby using the VCR gem.
I've configured VCR according to the documentation but cannot seem to get a cassette to record in the cassette directory. I've even changed the permissions on the cassette directory to 777 just in case. The really strange thing is, I've completely removed the cassette directory, run the specs, and then a new cassette directory is created.
I'm using Typhoeus
0.4.2 with Hydra
. I can't upgrade Typhoeus at the moment.
The relevant code:
require 'rspec'
require 'vcr'
require_relative File.join("..", "crawl_handler")
VCR.configure do |c|
c.cassette_library_dir = "spec/vcr_cassettes"
c.hook_into :fakeweb
c.allow_http_connections_when_no_cassette = false
end
... # => other describe statements
describe "#handle_http_response" do
before(:each) do
get_some_response = lambda {
# NOTE: typhoeus v. 0.5 is MUCH less setup :)
VCR.use_cassette("bme") do
request = Typhoeus::Request.new("www.bing.com")
hydra = Typhoeus::Hydra.new
hydra.queue(request)
hydra.run
response = request.response
end
}
@message = @subject.handle_http_response("www.bing.com", get_some_response.call)
end
it "returns a message hash" do
@message.should be_kind_of Hash
end
...
I have no idea why cassettes aren't being written.