I found Cucumber and VCR's official documentation good, but over-complicated for what I wanted to do. Here are the steps it actually took me to get it working quickly and simply in my features (using fakeweb).
- Create the file 'features/support/vcr.rb' with the following contents:
- Inside the step definitions (in my steps files under 'features/steps/'):
VCR.config do |c|
c.cassette_library_dir = 'features/cassettes'
VCR.use_cassette 'name' do
This will create the cassette file 'name' in the 'features/cassettes' directory. After recording your request/response the first time, any additional communications will be stopped by VCR, because the default options for VCR sets record to 'new episodes'.