Merge pull request #274 + fix to use FakeFS to avoid flakey test

This commit is contained in:
Steven Bazyl committed 2015-08-19 13:57:14 -07:00
commit a5a9b49160
3 files changed
+21 -3

No files matched your search

@@ -48,6 +48,13 @@ RSpec.describe Google::APIClient::ClientSecrets do
expect(hash["installed"]["client_secret"]).to be == 'i8YaXdGgiQ4_KrTVNGsB7QP1'
end
it 'should remove empty value' do
expect(hash["installed"]["redirect_uris"]).to be nil
end
it 'should remove nil values' do
expect(hash["installed"]["issued_at"]).to be nil
end
end
end
@@ -72,4 +79,12 @@ RSpec.describe Google::APIClient::ClientSecrets do
expect(secrets.client_id).to be == '898243283568.apps.googleusercontent.com'
end
end
context 'with folder wihout client_secrets.json' do
it "should raise exception", fakefs: true do
FileUtils.mkdir("/tmp")
expect { Google::APIClient::ClientSecrets.load('/tmp') }.to raise_exception(ArgumentError)
end
end
end
+2
View File
@@ -43,6 +43,7 @@ end
require 'rspec'
require 'webmock/rspec'
require 'fakefs/spec_helpers'
require 'json_spec'
require 'logging'
require 'rspec/logging_helper'
@@ -53,6 +54,7 @@ require 'google/apis/core/base_service'
# logs will be stored in the @log_output variable. It is a StringIO instance.
RSpec.configure do |config|
include RSpec::LoggingHelper
config.include FakeFS::SpecHelpers, fakefs: true
config.include JsonSpec::Helpers
config.include WebMock::API
config.capture_log_messages