From 82ae8a21a9426ee02796a12677a6cdc7d8745bee Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 25 Feb 2015 04:38:56 -0800 Subject: [PATCH 1/2] Add rubocop config files --- .rubocop.yml | 1 + .rubocop_todo.yml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..cc32da4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: .rubocop_todo.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..543d13f --- /dev/null +++ b/.rubocop_todo.yml @@ -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 From e097a9cae99af5b6ef1dfb9cd710aa0cf81dbb92 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Wed, 25 Feb 2015 04:39:22 -0800 Subject: [PATCH 2/2] Updates the tests work on ruby-1.9.3 and JRuby --- spec/googleauth/compute_engine_spec.rb | 3 ++- spec/googleauth/service_account_spec.rb | 3 ++- spec/googleauth/signet_spec.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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])