Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cassettes recorded in Ruby 1.8 won't work with Ruby 1.9 #149

Closed
nirvdrum opened this Issue · 2 comments

2 participants

@nirvdrum

It appears that cassettes recorded with Ruby 1.8 won't work with Ruby 1.9. It may be more nuanced than that because my 1.8 specs are run in JRuby and my 1.9 specs are run in MRI.

The core problem seems to be the cassette will not record an encoding value on 1.8. Since everything is implicitly UTF-8, this makes sense. However, in 1.9, a String does have an encoding, so the check on lib/vcr/structs.rb:36 fails, allowing line 37 to execute, which raises a nil error because the encoding is nil.

This seems fixable by changing line 24 to try_encode_string(hash['string'], hash['encoding'] || 'UTF-8').

@myronmarston myronmarston closed this issue from a commit
@myronmarston myronmarston Don't try to encode to a nil encoding.
This should allow cassettes recorded on 1.8 to work on 1.9.

Closes #149.
45b3fcf
@myronmarston

Thanks for reporting this. I just pushed a fix that should take care of it for you.

@nirvdrum

Thanks. That's a cleaner fix. I wasn't sure of the full ramifications of my suggestion so I wanted to evaluate more before issuing a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.