Merge prioridata-master

This commit is contained in:
Steven Bazyl 2014-12-15 13:42:17 -08:00
commit 91ae01aa83
2 changed files with 26 additions and 14 deletions

View File

@ -75,6 +75,8 @@ module Google
# @option options [String] :ca_file
# Optional set of root certificates to use when validating SSL connections.
# 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={})
logger.debug { "#{self.class} - Initializing client with options #{options}" }
@ -123,6 +125,11 @@ module Google
faraday.ssl.verify = true
faraday.proxy proxy
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
return self
end

View File

@ -59,6 +59,11 @@ RSpec.describe Google::APIClient do
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
expect(Google::APIClient::VERSION::STRING).to be_instance_of(String)
end