Skip to content

use VCR in development (or whatever Rails environment you please)

License

Notifications You must be signed in to change notification settings

BJK/vcr_cable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VcrCable

Build Status

This gem allows to use VCR in development. This is quite handy when your app interacts frequently with external services and you're on a sloppy connection, or when you want to save bandwidth, or when you happent to have no connection at all.

Usage

Add required gems to your Gemfile:

gem 'vcr_cable'
gem 'webmock' # or fakeweb

Now all external requests will hit the remote servers only one time, and the application will subsequently use the recorded data.

Custom VCR Configuration

The default VCR configuration values are (extracted from lib/vcr_cable.rb):

  DEFAULT_CONFIG = {
    'development' => {
      'hook_into' => :fakeweb,
      'cassette_library_dir' => 'development_cassettes',
      'allow_http_connections_when_no_cassette' => true
    }
  }

If you want to override those values you can generate the vcr_cable.yml config file and edit its params:

bundle exec rails generate vcr_cable

You will find the generated file in the config folder of your rails application.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add your feature tests to the rspec/cucumber test suite
  4. Commit your changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

About

use VCR in development (or whatever Rails environment you please)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 95.2%
  • JavaScript 2.6%
  • CSS 2.2%