Skip to content

Commit

Permalink
Make sure Faraday 2.x always has an adapter set
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 3, 2024
1 parent 0729f35 commit 7cd9f37
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rabbitmq/http/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def initialize_connection(endpoint, options = {})
user = uri.user || options.delete(:username) || "guest"
password = uri.password || options.delete(:password) || "guest"
options = options.merge(:url => uri.to_s)
adapter = options.delete(:adapter) || Faraday.default_adapter
adapter = options.delete(:adapter) || Faraday.default_adapter || :httpclient

@connection = Faraday.new(options) do |conn|
conn.request :authorization, :basic, user, password
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq_http_api_client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Gem::Specification.new do |gem|
gem.add_dependency 'addressable', '~> 2.7'
gem.add_dependency 'hashie', '~> 4.1'
gem.add_dependency 'multi_json', '~> 1.15'
gem.add_dependency 'faraday', '~> 2.0'
gem.add_dependency 'faraday', '~> 2.9'
gem.add_dependency 'faraday-follow_redirects', '~> 0.3'
end
1 change: 1 addition & 0 deletions spec/integration/api_endpoints_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def await_event_propagation
let(:queue_name) { "httpdeclared" }

it "declares a queue" do
@channel.queue_delete(queue_name)
subject.declare_queue("/", queue_name, durable: false, auto_delete: true)

q = @channel.queue(queue_name, durable: false, auto_delete: true)
Expand Down

0 comments on commit 7cd9f37

Please sign in to comment.