class EventMachine::WebMockHttpConnection
def activate_connection(client)
def activate_connection(client) request_signature = client.request_signature if client.stubbed_webmock_response conn = HttpStubConnection.new rand(10000) post_init @deferred = false @conn = conn conn.parent = self conn.pending_connect_timeout = @connopts.connect_timeout conn.comm_inactivity_timeout = @connopts.inactivity_timeout finalize_request(client) @conn.set_deferred_status :succeeded elsif WebMock.net_connect_allowed?(request_signature.uri) super else raise WebMock::NetConnectNotAllowedError.new(request_signature) end end
def drop_client
def drop_client @clients.shift end