-
Notifications
You must be signed in to change notification settings - Fork 968
/
em_http_test.rb
33 lines (25 loc) · 919 Bytes
/
em_http_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true
require File.expand_path('integration', __dir__)
module Adapters
class EMHttpTest < Faraday::TestCase
def adapter
:em_http
end
Integration.apply(self, :Parallel, :NonStreaming, :ParallelNonStreaming) do
# https://github.com/eventmachine/eventmachine/pull/289
undef :test_timeout
def test_binds_local_socket
host = '1.2.3.4'
conn = create_connection request: { bind: { host: host } }
assert_equal host, conn.options[:bind][:host]
end
end unless jruby? && ssl_mode?
# https://github.com/eventmachine/eventmachine/issues/180
def test_custom_adapter_config
url = URI('https://example.com:1234')
adapter = Faraday::Adapter::EMHttp.new nil, inactivity_timeout: 20
req = adapter.create_request(url: url, request: {})
assert_equal 20, req.connopts.inactivity_timeout
end
end
end