Add application name to client, update style of assigning client to match other recent changes
This commit is contained in:
parent
8f453134d7
commit
c793138209
|
@ -17,7 +17,7 @@ require 'google/api_client'
|
||||||
require 'google/api_client/version'
|
require 'google/api_client/version'
|
||||||
|
|
||||||
describe Google::APIClient::BatchRequest do
|
describe Google::APIClient::BatchRequest do
|
||||||
CLIENT = Google::APIClient.new unless defined?(CLIENT)
|
CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT)
|
||||||
|
|
||||||
after do
|
after do
|
||||||
# Reset client to not-quite-pristine state
|
# Reset client to not-quite-pristine state
|
||||||
|
|
|
@ -43,7 +43,7 @@ end
|
||||||
|
|
||||||
describe Google::APIClient do
|
describe Google::APIClient do
|
||||||
include ConnectionHelpers
|
include ConnectionHelpers
|
||||||
CLIENT = Google::APIClient.new unless defined?(CLIENT)
|
CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT)
|
||||||
|
|
||||||
after do
|
after do
|
||||||
# Reset client to not-quite-pristine state
|
# Reset client to not-quite-pristine state
|
||||||
|
@ -53,7 +53,7 @@ describe Google::APIClient do
|
||||||
|
|
||||||
it 'should raise a type error for bogus authorization' do
|
it 'should raise a type error for bogus authorization' do
|
||||||
(lambda do
|
(lambda do
|
||||||
Google::APIClient.new(:authorization => 42)
|
Google::APIClient.new(:application_name => 'API Client Tests', :authorization => 42)
|
||||||
end).should raise_error(TypeError)
|
end).should raise_error(TypeError)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ describe Google::APIClient do
|
||||||
it 'should allow modification to the base URIs for testing purposes' do
|
it 'should allow modification to the base URIs for testing purposes' do
|
||||||
# Using a new client instance here to avoid caching rebased discovery doc
|
# Using a new client instance here to avoid caching rebased discovery doc
|
||||||
prediction_rebase =
|
prediction_rebase =
|
||||||
Google::APIClient.new.discovered_api('prediction', 'v1.2')
|
Google::APIClient.new(:application_name => 'API Client Tests').discovered_api('prediction', 'v1.2')
|
||||||
prediction_rebase.method_base =
|
prediction_rebase.method_base =
|
||||||
'https://testing-domain.example.com/prediction/v1.2/'
|
'https://testing-domain.example.com/prediction/v1.2/'
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ describe Google::APIClient::UploadIO do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Google::APIClient::ResumableUpload do
|
describe Google::APIClient::ResumableUpload do
|
||||||
CLIENT ||= Google::APIClient.new
|
CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT)
|
||||||
|
|
||||||
after do
|
after do
|
||||||
# Reset client to not-quite-pristine state
|
# Reset client to not-quite-pristine state
|
||||||
|
|
|
@ -18,7 +18,7 @@ require 'google/api_client'
|
||||||
require 'google/api_client/version'
|
require 'google/api_client/version'
|
||||||
|
|
||||||
describe Google::APIClient::Result do
|
describe Google::APIClient::Result do
|
||||||
CLIENT ||= Google::APIClient.new
|
CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT)
|
||||||
|
|
||||||
describe 'with the plus API' do
|
describe 'with the plus API' do
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -59,7 +59,7 @@ end
|
||||||
describe Google::APIClient do
|
describe Google::APIClient do
|
||||||
include ConnectionHelpers
|
include ConnectionHelpers
|
||||||
|
|
||||||
let(:client) { Google::APIClient.new }
|
let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
|
||||||
|
|
||||||
it 'should make its version number available' do
|
it 'should make its version number available' do
|
||||||
Google::APIClient::VERSION::STRING.should be_instance_of(String)
|
Google::APIClient::VERSION::STRING.should be_instance_of(String)
|
||||||
|
|
Loading…
Reference in New Issue