debian-mirror-gitlab/spec/support/webmock.rb

13 lines
341 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
require 'webmock'
require 'webmock/rspec'
2019-05-18 00:54:41 +05:30
def webmock_allowed_hosts
%w[elasticsearch registry.gitlab.com-gitlab-org-test-elastic-image].tap do |hosts|
if ENV.key?('ELASTIC_URL')
hosts << URI.parse(ENV['ELASTIC_URL']).host
end
end.uniq
end
WebMock.disable_net_connect!(allow_localhost: true, allow: webmock_allowed_hosts)