Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (34 sloc) 1.387 kb
59e1d92 @myronmarston Add an upgrade guide.
authored
1 See the [Changelog](changelog) for a complete list of changes from VCR
2 1.x to 2.0. This file simply lists the most pertinent ones to upgrading.
3
4 ## Configuration Changes
5
6 In VCR 1.x, your configuration block would be something like this:
7
8 ``` ruby
9 VCR.config do |c|
10 c.cassette_library_dir = 'cassettes'
11 c.stub_with :fakeweb, :typhoeus
12 end
13 ```
14
15 This will continue to work in VCR 2.0 but will generate deprecation
16 warnings. Instead, you should change this to:
17
18 ``` ruby
19 VCR.configure do |c|
20 c.cassette_library_dir = 'cassettes'
21 c.hook_into :fakeweb, :typhoeus
22 end
23 ```
24
25 ## New Cassette Format
26
27 The cassette format has changed between VCR 1.x and VCR 2.0.
28 VCR 1.x cassettes cannot be used with VCR 2.0.
29
30 The easiest way to upgrade is to simply delete your cassettes and
31 re-record all of them. VCR also provides a rake task that attempts
32 to upgrade your 1.x cassettes to the new 2.0 format. To use it, add
33 the following line to your Rakefile:
34
35 ``` ruby
36 load 'vcr/tasks/vcr.rake'
37 ```
38
39 Then run `rake vcr:migrate_cassettes DIR=path/to/your/cassettes/directory` to
40 upgrade your cassettes. Note that this rake task may be unable to
41 upgrade some cassettes that make extensive use of ERB. In addition, now
42 that VCR 2.0 does less normalization then before, it may not be able to
43 migrate the cassette perfectly. It's recommended that you delete and
44 re-record your cassettes if you are able.
45
Something went wrong with that request. Please try again.