# File lib/vcr/http_stubbing_adapters/excon.rb, line 37 def create_stubs_checkpoint(cassette) checkpoints[cassette] = stub_queue_dup end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 16 def http_connections_allowed? !!@http_connections_allowed end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 20 def ignored_hosts=(hosts) @ignored_hosts = hosts end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 54 def reset! instance_variables.each do |ivar| remove_instance_variable(ivar) end end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 41 def restore_stubs_checkpoint(cassette) match_attributes_stack.pop @stub_queues = checkpoints.delete(cassette) || super end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 29 def stub_requests(http_interactions, match_attributes) match_attributes_stack << match_attributes grouped_responses(http_interactions, match_attributes).each do |request_matcher, responses| queue = stub_queues[request_matcher] responses.each { |res| queue << res } end end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 46 def stubbed_response_for(request) return nil unless match_attributes_stack.any? request_matcher = request.matcher(match_attributes_stack.last) queue = stub_queues[request_matcher] return queue.shift if queue.size > 1 queue.first end
# File lib/vcr/http_stubbing_adapters/excon.rb, line 24 def uri_should_be_ignored?(uri) uri = URI.parse(uri) unless uri.respond_to?(:host) ignored_hosts.include?(uri.host) end