Skip to content

Instantly share code, notes, and snippets.

@josepjaume
Created August 10, 2012 09:37
Show Gist options
  • Save josepjaume/3312970 to your computer and use it in GitHub Desktop.
Save josepjaume/3312970 to your computer and use it in GitHub Desktop.
Spinach and VCR
gem 'webmock'
gem 'vcr'
# features/support/vcr.rb
VCR.configure do |c|
c.default_cassette_options = {record: :new_episodes}
c.cassette_library_dir = 'fixtures/vcr_cassettes'
c.hook_into :webmock
c.ignore_localhost = true
end
Spinach.hooks.before_scenario do |scenario|
VCR.insert_cassette(scenario.name.parameterize)
end
Spinach.hooks.after_scenario do
VCR.eject_cassette
end
@wojtha
Copy link

wojtha commented Apr 24, 2013

Funny, I'm just in need of this...
Last updated 2 minutes ago

@lgs
Copy link

lgs commented Jun 8, 2013

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment