myronmarston/vcr — Issue #118: cassette_dir should evaluate to an absolute path
Author: heythisisnate
Created: 2011-12-21 22:03:00+00:00
State: open

Normally doing this should be ok:

VCR.configure do |config|
config.cassette_library_dir = 'spec/fixtures/vcr'
end

But in one case I installed VCR on a project and was _really_ confused for a while when my cassettes seemed to be not recording. After a couple hours of investigation, I found that there were some places in my application's code that would shell out to `cd` which would change the working directory. From that point onward, VCR would start recording cassettes into a directory relative to the new cwd.

I solved this problem by setting the casssete_library_dir to an absolute path:

VCR.configure do |config|
config.cassette_library_dir = Rails.root.join('spec','fixtures','vcr')
end

It would be nice if VCR did this for me internally, to avoid future confusion.