diff --git a/spec/acceptance/async_http_client/async_http_client_spec.rb b/spec/acceptance/async_http_client/async_http_client_spec.rb index 6196657b..43d42464 100644 --- a/spec/acceptance/async_http_client/async_http_client_spec.rb +++ b/spec/acceptance/async_http_client/async_http_client_spec.rb @@ -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 @@ -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) diff --git a/spec/acceptance/async_http_client/async_http_client_spec_helper.rb b/spec/acceptance/async_http_client/async_http_client_spec_helper.rb index 4f6b42c5..d465505e 100644 --- a/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +++ b/spec/acceptance/async_http_client/async_http_client_spec_helper.rb @@ -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( @@ -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