Merge pull request #11 from tbetbetbe/ruby-auth-fix-tests-on-other-rubies

Ruby auth fix tests on other rubies
This commit is contained in:
Tim Emiola 2015-02-25 05:07:52 -08:00
commit 36ceadc26f
5 changed files with 22 additions and 3 deletions

1
.rubocop.yml Normal file
View File

@ -0,0 +1 @@
inherit_from: .rubocop_todo.yml

15
.rubocop_todo.yml Normal file
View File

@ -0,0 +1,15 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-02-25 04:34:33 -0800 using RuboCop version 0.28.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
Metrics/AbcSize:
Max: 16
# Offense count: 1
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 11

View File

@ -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]

View File

@ -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])

View File

@ -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])