Updates the tests work on ruby-1.9.3 and JRuby

This commit is contained in:
Tim Emiola 2015-02-25 04:39:22 -08:00
parent 82ae8a21a9
commit e097a9cae9
3 changed files with 6 additions and 3 deletions

View File

@ -44,7 +44,8 @@ describe Google::Auth::GCECredentials do
@client = GCECredentials.new @client = GCECredentials.new
end end
def make_auth_stubs(access_token: '') def make_auth_stubs(opts = {})
access_token = opts[:access_token] || ''
Faraday::Adapter::Test::Stubs.new do |stub| Faraday::Adapter::Test::Stubs.new do |stub|
stub.get(MD_URI) do |env| stub.get(MD_URI) do |env|
headers = env[:request_headers] headers = env[:request_headers]

View File

@ -50,7 +50,8 @@ describe Google::Auth::ServiceAccountCredentials do
StringIO.new(cred_json_text)) StringIO.new(cred_json_text))
end end
def make_auth_stubs(access_token: '') def make_auth_stubs(opts = {})
access_token = opts[:access_token] || ''
Faraday::Adapter::Test::Stubs.new do |stub| Faraday::Adapter::Test::Stubs.new do |stub|
stub.post('/oauth2/v3/token') do |env| stub.post('/oauth2/v3/token') do |env|
params = Addressable::URI.form_unencode(env[:body]) params = Addressable::URI.form_unencode(env[:body])

View File

@ -49,7 +49,8 @@ describe Signet::OAuth2::Client do
) )
end end
def make_auth_stubs(access_token: '') def make_auth_stubs(opts)
access_token = opts[:access_token] || ''
Faraday::Adapter::Test::Stubs.new do |stub| Faraday::Adapter::Test::Stubs.new do |stub|
stub.post('/o/oauth2/token') do |env| stub.post('/o/oauth2/token') do |env|
params = Addressable::URI.form_unencode(env[:body]) params = Addressable::URI.form_unencode(env[:body])