Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:01:04+00:00 2026-06-15T10:01:04+00:00

I have a very simple module I’m testing with Ruby using the VCR gem.

  • 0

I have a very simple module I’m testing with Ruby using the VCR gem.

I’ve configured VCR according to the documentation but cannot seem to get a cassette to record in the cassette directory. I’ve even changed the permissions on the cassette directory to 777 just in case. The really strange thing is, I’ve completely removed the cassette directory, run the specs, and then a new cassette directory is created.

I’m using Typhoeus 0.4.2 with Hydra. I can’t upgrade Typhoeus at the moment.

The relevant code:

require 'rspec'                                                                     
require 'vcr'                                                                       
require_relative File.join("..", "crawl_handler")                                   

VCR.configure do |c|                                                                
  c.cassette_library_dir = "spec/vcr_cassettes"                                     
  c.hook_into :fakeweb                                                              
  c.allow_http_connections_when_no_cassette = false                                 
end

... # => other describe statements
 describe "#handle_http_response" do                                               
    before(:each) do                                                                
      get_some_response = lambda {                                                  
        # NOTE: typhoeus v. 0.5 is MUCH less setup :)                               
        VCR.use_cassette("bme") do                                                  
          request = Typhoeus::Request.new("www.bing.com")                           
          hydra = Typhoeus::Hydra.new                                               
          hydra.queue(request)                                                      
          hydra.run                                                                 
          response = request.response                                               
        end                                                                         
      }                                                                             
      @message = @subject.handle_http_response("www.bing.com", get_some_response.call)    
    end                                                                             

    it "returns a message hash" do                                                  
      @message.should be_kind_of Hash                                               
    end  

    ...

I have no idea why cassettes aren’t being written.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:01:04+00:00Added an answer on June 15, 2026 at 10:01 am

    The problem is that you are using Typhoeus as your HTTP client, but hooking into FakeWeb, which only provides support for Net::HTTP. VCR can hook directly into Typhoeus (since it provides good public APIs for doing so) if you configure it:

    VCR.configure do |vcr|
      vcr.hook_into :typhoeus
    end
    

    The hook_into docs list all the options and which hooks work with which HTTP clients. If you have any suggestions for improving the documentation to prevent others from having this confusion, please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple Win32 application that uses CAtlExeModuleT. The module simply creates
Very simple problem: I have a Public Sub (in a module) that I want
I have a Sinatra app utilizing Sequel and Postgres... it's a very simple module
I have a very simple git repository that I've been using to learn git.
I have a very simple model form, but for some reason, the code fails
I am trying to create a very simple page in my module using hook_menu()
I have a very simple application that works but when i add roboguice it
I have very simple piece of code. The goal is when i input four-digit
I have very simple OpenGL ES example similar to Hehe's example : http://nehe.gamedev.net/tutorial/ios_lesson_02__first_triangle/50001/ As
I have very simple window where I have 2 buttons - one for cancel,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.