Skip to content

Commit

Permalink
Miscellaneous fixes, including updating tests to work with ruby 2.0 a…
Browse files Browse the repository at this point in the history
…nd ruby 2.1.
  • Loading branch information
mcloonan committed Jun 12, 2014
1 parent f1cb6e5 commit 97b7206
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 151 deletions.
2 changes: 1 addition & 1 deletion ads_common/google-ads-common.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.rubyforge_project = 'google-ads-common'
s.require_path = 'lib'
s.files = Dir.glob('{lib,test}/**/*') + %w(COPYING README ChangeLog)
s.files = Dir.glob('{lib,test}/**/*') + %w(COPYING README.md ChangeLog)
s.test_files = Dir.glob('test/test_*.rb')
s.add_dependency('savon', '~> 1.2.0')
s.add_dependency('httpi', '~> 1.1.0')
Expand Down
8 changes: 4 additions & 4 deletions ads_common/test/test_credential_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ def test_auth_handler_callback_compare()
credentials[:foo] = 'bar'
credentials[:baz] = 42
mock1 = MiniTest::Mock.new()
mock1.expect(:property_changed, nil, [:foo, 'bar'])
mock1.expect(:property_changed, nil, [:baz, 42])
mock1.expect(:property_changed, nil, [:baz, 42])
@handler.set_auth_handler(mock1)
@handler.credentials = credentials
assert(mock1.verify)

credentials.delete(:baz)
mock2 = MiniTest::Mock.new()
mock2.expect(:property_changed, nil, [:baz, nil])
mock2.expect(:property_changed, nil, [:baz, nil])
@handler.set_auth_handler(mock2)
@handler.credentials = credentials
assert(mock2.verify)

credentials[:foo] = nil
mock3 = MiniTest::Mock.new()
mock3.expect(:property_changed, nil, [:foo, nil])
mock3.expect(:property_changed, nil, [:foo, nil])
mock3.expect(:property_changed, nil, [:baz, nil])
@handler.set_auth_handler(mock3)
@handler.credentials = credentials
assert(mock3.verify)
Expand Down
10 changes: 7 additions & 3 deletions adwords_api/test/adwords_api/test_adwords_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ def test_clientlogin_removal()
:authentication => {:method => 'ClientLogin'},
:service => {:environment => 'PRODUCTION'}
})
assert_nothing_raised(adwords_api.service(:CampaignService,
LAST_CLIENT_LOGIN_API_VERSION))
assert_raise(adwords_api.service(:CampaignService, API_VERSION))
assert_nothing_raised do
service = adwords_api.service(:CampaignService,
LAST_CLIENT_LOGIN_API_VERSION)
end
assert_raise(AdsCommon::Errors::AuthError) do
service = adwords_api.service(:CampaignService, API_VERSION)
end
end
end
141 changes: 0 additions & 141 deletions adwords_api/test/bugs/test_issue_00000063.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_mocks()
{"env:Envelope"=>
{"env:Header"=>
{"wsdl:RequestHeader"=>
{"userAgent"=>"ruby-tests (AwApi-Ruby/0.11.1, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)",
{"userAgent"=>"ruby-tests (AwApi-Ruby/0.11.2, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)",
"developerToken"=>"dev_token123",
"clientCustomerId"=>"123-456-7890",
"authToken"=>"abcAuthbcd",
Expand Down
2 changes: 1 addition & 1 deletion adwords_api/test/templates/v201309/misc_use_oauth2_jwt.def
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setup_mocks()
{"env:Envelope"=>
{"env:Header"=>
{"wsdl:RequestHeader"=>
{"userAgent"=>"ruby-tests (AwApi-Ruby/0.11.1, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)",
{"userAgent"=>"ruby-tests (AwApi-Ruby/0.11.2, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)",
"developerToken"=>"dev_token123",
"clientCustomerId"=>"123-456-7890",
"xmlns"=>"https://adwords.google.com/api/adwords/cm/v201309"}},
Expand Down

0 comments on commit 97b7206

Please sign in to comment.