diff --git a/spec/googleauth/compute_engine_spec.rb b/spec/googleauth/compute_engine_spec.rb index 209fb12..5b5ba06 100644 --- a/spec/googleauth/compute_engine_spec.rb +++ b/spec/googleauth/compute_engine_spec.rb @@ -44,7 +44,8 @@ describe Google::Auth::GCECredentials do @client = GCECredentials.new end - def make_auth_stubs(access_token: '') + def make_auth_stubs(opts = {}) + access_token = opts[:access_token] || '' Faraday::Adapter::Test::Stubs.new do |stub| stub.get(MD_URI) do |env| headers = env[:request_headers] diff --git a/spec/googleauth/service_account_spec.rb b/spec/googleauth/service_account_spec.rb index e6657b4..f0ec305 100644 --- a/spec/googleauth/service_account_spec.rb +++ b/spec/googleauth/service_account_spec.rb @@ -50,7 +50,8 @@ describe Google::Auth::ServiceAccountCredentials do StringIO.new(cred_json_text)) end - def make_auth_stubs(access_token: '') + def make_auth_stubs(opts = {}) + access_token = opts[:access_token] || '' Faraday::Adapter::Test::Stubs.new do |stub| stub.post('/oauth2/v3/token') do |env| params = Addressable::URI.form_unencode(env[:body]) diff --git a/spec/googleauth/signet_spec.rb b/spec/googleauth/signet_spec.rb index 09bb24b..de02d16 100644 --- a/spec/googleauth/signet_spec.rb +++ b/spec/googleauth/signet_spec.rb @@ -49,7 +49,8 @@ describe Signet::OAuth2::Client do ) end - def make_auth_stubs(access_token: '') + def make_auth_stubs(opts) + access_token = opts[:access_token] || '' Faraday::Adapter::Test::Stubs.new do |stub| stub.post('/o/oauth2/token') do |env| params = Addressable::URI.form_unencode(env[:body])