allows to pass FaraDay options furthur to FaraDay configuration block upon client initialization
This commit is contained in:
parent
bfa5225766
commit
2f88bc5487
|
@ -119,6 +119,11 @@ module Google
|
|||
faraday.ssl.ca_file = ca_file
|
||||
faraday.ssl.verify = true
|
||||
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
|
||||
|
|
|
@ -60,6 +60,11 @@ 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})
|
||||
client.connection.options.timeout.should == 999
|
||||
end
|
||||
|
||||
it 'should make its version number available' do
|
||||
Google::APIClient::VERSION::STRING.should be_instance_of(String)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue