Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@JEG2 /Gemfile
Created Nov 20, 2012

Another Typhoeus VCR Interaction Bug
require "bundler/setup"
require "vcr"
require "typhoeus"
VCR.configure do |config|
config.cassette_library_dir = File.join( File.dirname(__FILE__),
"vcr_cassettes" )
config.hook_into :typhoeus
describe "Typhoeus used with VCR" do
it "should work with nested queuing" do
VCR.use_cassette("nested") do
success = false
hydra =
request ="")
request.on_success do |response|
nested ="")
nested.on_success do |_|
success = true
expect(success).to be_true
# $ rspec bug_spec.rb
# F
# Failures:
# 1) Typhoeus used with VCR should work with nested queuing
# Failure/Error:
# NameError:
# instance variable @__typed_vcr_request not defined
# # ./bug_spec.rb:26:in `block (3 levels) in <top (required)>'
# # ./bug_spec.rb:13:in `block (2 levels) in <top (required)>'
# Finished in 0.22194 seconds
# 1 example, 1 failure
# Failed examples:
# rspec ./bug_spec.rb:12 # Typhoeus used with VCR should work with nested queuing
source :rubygems
gem "typhoeus", "~> 0.5.2"
gem "vcr", "~> 2.3.0"
gem "rspec"
i0rek commented Nov 21, 2012

Please change on_success to on_complete since a redirect doesn't count as a successful response: Or add followlocation: true.

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.