adds specs for file_store

This commit is contained in:
Volker Zöpfel committed 2013-12-03 08:30:55 +01:00
1 parent b1f8ac3c0d
commit 71eeabe55c
3 files changed
+39 -17

No files matched your search

@@ -37,7 +37,7 @@ module Google
##
# Attempt to read in credentials from the specified file.
def load_credentials
File.open(path, 'r') { |f| JSON.parse(f.read) }
open(path, 'r') { |f| JSON.parse(f.read) }
rescue
nil
end
@@ -49,8 +49,8 @@ module Google
# Optional authorization instance. If not provided, the authorization
# already associated with this instance will be written.
def write_credentials(credentials_hash)
File.open(self.path, 'w') do |file|
file.write(credentials_hash.to_json)
open(self.path, 'w+') do |f|
f.write(credentials_hash.to_json)
end
end
end