diff --git a/spec/google/api_client/batch_spec.rb b/spec/google/api_client/batch_spec.rb index 7eed46f29..1c28095ff 100644 --- a/spec/google/api_client/batch_spec.rb +++ b/spec/google/api_client/batch_spec.rb @@ -17,7 +17,7 @@ require 'google/api_client' require 'google/api_client/version' 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 # Reset client to not-quite-pristine state diff --git a/spec/google/api_client/discovery_spec.rb b/spec/google/api_client/discovery_spec.rb index a1741d963..4f8fcca7b 100644 --- a/spec/google/api_client/discovery_spec.rb +++ b/spec/google/api_client/discovery_spec.rb @@ -43,7 +43,7 @@ end describe Google::APIClient do include ConnectionHelpers - CLIENT = Google::APIClient.new unless defined?(CLIENT) + CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT) after do # 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 (lambda do - Google::APIClient.new(:authorization => 42) + Google::APIClient.new(:application_name => 'API Client Tests', :authorization => 42) end).should raise_error(TypeError) end @@ -258,7 +258,7 @@ describe Google::APIClient 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 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 = 'https://testing-domain.example.com/prediction/v1.2/' diff --git a/spec/google/api_client/media_spec.rb b/spec/google/api_client/media_spec.rb index af1e01d0a..ed70ec309 100644 --- a/spec/google/api_client/media_spec.rb +++ b/spec/google/api_client/media_spec.rb @@ -58,7 +58,7 @@ describe Google::APIClient::UploadIO do end describe Google::APIClient::ResumableUpload do - CLIENT ||= Google::APIClient.new + CLIENT = Google::APIClient.new(:application_name => 'API Client Tests') unless defined?(CLIENT) after do # Reset client to not-quite-pristine state diff --git a/spec/google/api_client/result_spec.rb b/spec/google/api_client/result_spec.rb index a442f51be..55a01da32 100644 --- a/spec/google/api_client/result_spec.rb +++ b/spec/google/api_client/result_spec.rb @@ -18,7 +18,7 @@ require 'google/api_client' require 'google/api_client/version' 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 before do diff --git a/spec/google/api_client_spec.rb b/spec/google/api_client_spec.rb index 2d9c974b0..a89ab10ae 100644 --- a/spec/google/api_client_spec.rb +++ b/spec/google/api_client_spec.rb @@ -59,7 +59,7 @@ end describe Google::APIClient do 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 Google::APIClient::VERSION::STRING.should be_instance_of(String)