allow_http_connections_when_no_cassette=(value)
click to toggle source
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
def allow_http_connections_when_no_cassette?
!!@allow_http_connections_when_no_cassette
end
cassette_library_dir=(cassette_library_dir)
click to toggle source
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
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
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
def http_stubbing_libraries
@http_stubbing_libraries ||= []
end
http_stubbing_library()
click to toggle source
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
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
ignore_hosts(*hosts)
click to toggle source
def ignore_hosts(*hosts)
ignored_hosts.push(*hosts).uniq!
VCR.http_stubbing_adapter.ignored_hosts = ignored_hosts if http_stubbing_libraries.any?
end
ignore_localhost=(value)
click to toggle source
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
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
def ignored_hosts
@ignored_hosts ||= []
end
stub_with(*http_stubbing_libraries)
click to toggle source
def stub_with(*http_stubbing_libraries)
@http_stubbing_libraries = http_stubbing_libraries
end
uri_should_be_ignored?(uri)
click to toggle source
def uri_should_be_ignored?(uri)
uri = URI.parse(uri) unless uri.respond_to?(:host)
ignored_hosts.include?(uri.host)
end