Skip to content

Commit

Permalink
fix uri parse error
Browse files Browse the repository at this point in the history
looks like httpclient behaves differently when 'addressable' is
available
and webmock depends on it, but productized image does not have test only
dependencies like that
  • Loading branch information
mikz committed Jun 27, 2019
1 parent a89f14e commit f7414f6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

group :test do
gem 'minitest-reporters'
gem 'minitest-stub-const'
gem 'webmock'
gem 'codecov', require: false
end
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ GEM
builder
minitest (>= 5.0)
ruby-progressbar
minitest-stub-const (0.5)
modware (0.1.3)
key_struct (~> 0.4)
msgpack (1.2.10)
Expand Down Expand Up @@ -344,6 +345,7 @@ DEPENDENCIES
lograge
message_bus
minitest-reporters
minitest-stub-const
oauth2
pg (>= 0.20)
prometheus-client
Expand Down
2 changes: 1 addition & 1 deletion app/adapters/abstract_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def build_http_client(endpoint)
HTTPClient.new do
self.debug_dev = $stderr if ENV.fetch('DEBUG', '0') == '1'

self.set_auth endpoint, *endpoint.auth
self.set_auth endpoint.uri.dup, *endpoint.auth

Rails.application.config.x.http_client.deep_symbolize_keys
.slice(:connect_timeout, :send_timeout, :receive_timeout).each do |key, value|
Expand Down
6 changes: 6 additions & 0 deletions test/adapters/abstract_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ class AbstractAdapterTest < ActiveSupport::TestCase
assert_equal uri,
subject.new('http://id:[email protected]:3000/auth/realm/name/').endpoint
end

test 'http_client' do
HTTPClient::Util.stub_const(:AddressableEnabled, false) do
assert_kind_of subject, subject.new('http://id:[email protected]')
end
end
end

0 comments on commit f7414f6

Please sign in to comment.