VCR::Config

Attributes

cassette_library_dir[R]
default_cassette_options[W]

Public Instance Methods

allow_http_connections_when_no_cassette=(value) click to toggle source
# File lib/vcr/config.rb, line 53
def allow_http_connections_when_no_cassette=(value)
  @allow_http_connections_when_no_cassette = value
  VCR.http_stubbing_adapter.set_http_connections_allowed_to_default if http_stubbing_libraries.any?
end
allow_http_connections_when_no_cassette?() click to toggle source
# File lib/vcr/config.rb, line 58
def allow_http_connections_when_no_cassette?
  !!@allow_http_connections_when_no_cassette
end
cassette_library_dir=(cassette_library_dir) click to toggle source
# File lib/vcr/config.rb, line 14
def cassette_library_dir=(cassette_library_dir)
  @cassette_library_dir = cassette_library_dir
  FileUtils.mkdir_p(cassette_library_dir) if cassette_library_dir
end
default_cassette_options() click to toggle source
# File lib/vcr/config.rb, line 20
def default_cassette_options
  @default_cassette_options ||= {}
  @default_cassette_options[:match_requests_on] ||= RequestMatcher::DEFAULT_MATCH_ATTRIBUTES
  @default_cassette_options[:record] ||= :once
  @default_cassette_options
end
filter_sensitive_data(placeholder, tag = nil, &block) click to toggle source
# File lib/vcr/config.rb, line 62
def filter_sensitive_data(placeholder, tag = nil, &block)
  before_record(tag) do |interaction|
    interaction.filter!(call_block(block, interaction), placeholder)
  end

  before_playback(tag) do |interaction|
    interaction.filter!(placeholder, call_block(block, interaction))
  end
end
http_stubbing_libraries() click to toggle source
# File lib/vcr/config.rb, line 31
def http_stubbing_libraries
  @http_stubbing_libraries ||= []
end
http_stubbing_library() click to toggle source
# File lib/vcr/deprecations/config.rb, line 3
def http_stubbing_library
  warn "WARNING: `VCR::Config.http_stubbing_library` is deprecated.  Use `VCR::Config.http_stubbing_libraries` instead."
  @http_stubbing_libraries && @http_stubbing_libraries.first
end
http_stubbing_library=(library) click to toggle source
# File lib/vcr/deprecations/config.rb, line 8
def http_stubbing_library=(library)
  warn "WARNING: `VCR::Config.http_stubbing_library = #{library.inspect}` is deprecated.  Use `VCR::Config.stub_with #{library.inspect}` instead."
  stub_with library
end
ignore_host(*hosts) click to toggle source
Alias for: ignore_hosts
ignore_hosts(*hosts) click to toggle source
# File lib/vcr/config.rb, line 35
def ignore_hosts(*hosts)
  ignored_hosts.push(*hosts).uniq!
  VCR.http_stubbing_adapter.ignored_hosts = ignored_hosts if http_stubbing_libraries.any?
end
Also aliased as: ignore_host
ignore_localhost=(value) click to toggle source
# File lib/vcr/config.rb, line 45
def ignore_localhost=(value)
  if value
    ignore_hosts *VCR::LOCALHOST_ALIASES
  else
    ignored_hosts.reject! { |h| VCR::LOCALHOST_ALIASES.include?(h) }
  end
end
ignore_localhost?() click to toggle source
# File lib/vcr/deprecations/config.rb, line 13
def ignore_localhost?
  warn "WARNING: `VCR::Config.ignore_localhost?` is deprecated.  Check the list of ignored hosts using `VCR::Config.ignored_hosts` instead."
  (VCR::LOCALHOST_ALIASES - ignored_hosts).empty?
end
ignored_hosts() click to toggle source
# File lib/vcr/config.rb, line 41
def ignored_hosts
  @ignored_hosts ||= []
end
stub_with(*http_stubbing_libraries) click to toggle source
# File lib/vcr/config.rb, line 27
def stub_with(*http_stubbing_libraries)
  @http_stubbing_libraries = http_stubbing_libraries
end
uri_should_be_ignored?(uri) click to toggle source
# File lib/vcr/config.rb, line 72
def uri_should_be_ignored?(uri)
  uri = URI.parse(uri) unless uri.respond_to?(:host)
  ignored_hosts.include?(uri.host)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.