Module: VCR::RSpec::Macros
- Defined in:
- lib/vcr/test_frameworks/rspec.rb
Overview
Contains macro methods to assist with VCR usage. These methods are intended to be used directly in an RSpec example group. To make these available in your RSpec example groups, extend the module in an individual example group, or configure RSpec to extend the module in all example groups.
Instance Method Summary collapse
-
#use_vcr_cassette(*args) ⇒ Object
Sets up a +before+ and +after+ hook that will insert and eject a cassette, respectively.
Instance Method Details
#use_vcr_cassette(*args) ⇒ Object
Sets up a +before+ and +after+ hook that will insert and eject a cassette, respectively.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vcr/test_frameworks/rspec.rb', line 28 def use_vcr_cassette(*args) = args.last.is_a?(Hash) ? args.pop : {} name = args.first || infer_cassette_name before(:each) do VCR.insert_cassette(name, ) end after(:each) do VCR.eject_cassette end end |