Sha256: e0492eb32926ba4a90f9ba66924e92a00b6f46c082940186e81f5c9c5ccd9e11

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

require 'vcr'
require 'webmock/rspec'

VCR.configure do |c|
  c.cassette_library_dir     = "spec/cassettes"
  c.hook_into                :webmock
end

RSpec.configure do |config|
  config.around(:each, :vcr) do |example|
    name = example.metadata[:full_description].split(/\s+/, 2).join("/").underscore.gsub(/[^\w\/]+/, "_")
    options = example.metadata.slice(:record, :match_requests_on).except(:example_group)
    VCR.use_cassette(name, options) { example.call }
  end
end

# Usage:
# it 'sends request', :vcr, record: :new_episodes do
#   . . .
# end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
teleporter-0.0.13 lib/generators/initial/templates/rspec_base/vcr.rb
teleporter-0.0.12 lib/generators/initial/templates/rspec_base/vcr.rb