Skip to content

Commit 39a4c5c

Browse files
committed
Replace Async::IO::Socket usage with stdlib Socket for async-http adapter to remove implicit dependency on async-io
1 parent fc6a2ab commit 39a4c5c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/webmock/http_lib_adapters/async_http_client_adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ def inspect
154154

155155
def create_connected_sockets
156156
pair = begin
157-
Async::IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
157+
Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
158158
rescue Errno::EAFNOSUPPORT
159-
Async::IO::Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM)
159+
Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM)
160160
end
161161
pair.tap do |sockets|
162162
sockets.each do |socket|

spec/acceptance/async_http_client/async_http_client_spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "ostruct"
2+
13
module AsyncHttpClientSpecHelper
24
def http_request(method, url, options = {}, &block)
35
endpoint = Async::HTTP::Endpoint.parse(url)

0 commit comments

Comments
 (0)