Skip to content

Commit

Permalink
Merge pull request #1040 from mattbrictson/fix-async-specs
Browse files Browse the repository at this point in the history
Fix failing Async::HTTP specs due to Async API change
  • Loading branch information
bblimke committed Feb 4, 2024
2 parents 25584ff + ee03e77 commit fc13468
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion spec/acceptance/async_http_client/async_http_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
end

def make_request(method, url, protocol: nil, headers: {}, body: nil)
Async do
result = Async do
endpoint = Async::HTTP::Endpoint.parse(url)

begin
Expand All @@ -362,6 +362,8 @@ def make_request(method, url, protocol: nil, headers: {}, body: nil)
e
end
end.wait

result.is_a?(Exception) ? raise(result) : result
end

def response_to_hash(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def http_request(method, url, options = {}, &block)

body = options[:body]

Async do
result = Async do
begin
Async::HTTP::Client.open(endpoint) do |client|
response = client.send(
Expand All @@ -34,6 +34,8 @@ def http_request(method, url, options = {}, &block)
e
end
end.wait

result.is_a?(Exception) ? raise(result) : result
end

def client_timeout_exception_class
Expand Down

0 comments on commit fc13468

Please sign in to comment.