Sha256: acb13a06977a6d53b5ccdcb219b56283330fd16753aa1358e65c931fe1a040f8

Contents?: true

Size: 1.31 KB

Versions: 10

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

##############################################################################
#                                 VCR Plugin
##############################################################################

begin
  require 'vcr'
  Dir[File.expand_path('../../vcr_matchers/**/*.rb', __FILE__)].each { |f| require f }

  begin
    require 'webmock'

    VCR.configure do |config|
      config.hook_into :webmock
    end
  rescue LoadError
  end

  begin
    require 'faraday'

    VCR.configure do |config|
      config.hook_into :faraday
    end
  rescue LoadError
  end

  RSpec.configure do |config|
    config.around(:each, :vcr => lambda { |v| !!v }) do |example|
      VCR.configuration.allow_http_connections_when_no_cassette = false

      example.run

      VCR.configuration.allow_http_connections_when_no_cassette = true
    end
  end

  VCR.configure do |config|
    config.ignore_hosts 'lvh.me', 'localhost', '127.0.0.1', '0.0.0.0'

    config.cassette_library_dir                    = File.expand_path('./tmp/vcr_cassettes')
    config.allow_http_connections_when_no_cassette = true

    # So that the Code Climate coverage reporter (if installed) can send reports
    # even though VCR is enabled.
    config.ignore_hosts 'codeclimate.com'

    config.configure_rspec_metadata!
  end
rescue LoadError
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspeckled-0.0.40 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.39 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.38 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.37 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.36 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.35 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.34 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.33 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.32 lib/rspeckled/plugins/vcr.rb
rspeckled-0.0.31 lib/rspeckled/plugins/vcr.rb