Skip to content

Instantly share code, notes, and snippets.

@opsb
Created March 21, 2013 16:02
Show Gist options
  • Select an option

  • Save opsb/5214214 to your computer and use it in GitHub Desktop.

Select an option

Save opsb/5214214 to your computer and use it in GitHub Desktop.
VCR config for spinach
VCR.config do |c|
c.cassette_library_dir = 'features/vcr_cassettes'
end
Spinach.hooks.before_scenario do |scenario|
cassette_name = "#{scenario.feature.name.parameterize.underscore}/#{scenario.name.parameterize.underscore}"
VCR.insert_cassette(cassette_name, :record => :once)
end
Spinach.hooks.after_scenario do |scenario|
VCR.eject_cassette
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment