Merge prioridata-master
This commit is contained in:
commit
91ae01aa83
|
@ -75,6 +75,8 @@ module Google
|
||||||
# @option options [String] :ca_file
|
# @option options [String] :ca_file
|
||||||
# Optional set of root certificates to use when validating SSL connections.
|
# Optional set of root certificates to use when validating SSL connections.
|
||||||
# By default, a bundled set of trusted roots will be used.
|
# By default, a bundled set of trusted roots will be used.
|
||||||
|
# @options options[Hash] :faraday_options
|
||||||
|
# Pass through of options to set on the Faraday connection
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
logger.debug { "#{self.class} - Initializing client with options #{options}" }
|
logger.debug { "#{self.class} - Initializing client with options #{options}" }
|
||||||
|
|
||||||
|
@ -123,6 +125,11 @@ module Google
|
||||||
faraday.ssl.verify = true
|
faraday.ssl.verify = true
|
||||||
faraday.proxy proxy
|
faraday.proxy proxy
|
||||||
faraday.adapter Faraday.default_adapter
|
faraday.adapter Faraday.default_adapter
|
||||||
|
if options[:faraday_option].is_a?(Hash)
|
||||||
|
options[:faraday_option].each_pair do |option, value|
|
||||||
|
faraday.options.send("#{option}=", value)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,11 @@ RSpec.describe Google::APIClient do
|
||||||
|
|
||||||
let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
|
let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
|
||||||
|
|
||||||
|
it "should pass the faraday options provided on initialization to FaraDay configuration block" do
|
||||||
|
client = Google::APIClient.new(faraday_option: {timeout: 999})
|
||||||
|
expect(client.connection.options.timeout).to be == 999
|
||||||
|
end
|
||||||
|
|
||||||
it 'should make its version number available' do
|
it 'should make its version number available' do
|
||||||
expect(Google::APIClient::VERSION::STRING).to be_instance_of(String)
|
expect(Google::APIClient::VERSION::STRING).to be_instance_of(String)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue