adds spec construct for file_store and storage
authorVolker Zöpfel <volker@zoepfel.de>
Fri, 15 Nov 2013 08:36:30 +0000 (09:36 +0100)
committerVolker Zöpfel <volker@zoepfel.de>
Fri, 15 Nov 2013 08:36:30 +0000 (09:36 +0100)
spec/google/api_client/auth/file_storage_spec.rb [deleted file]
spec/google/api_client/auth/storage_spec.rb [new file with mode: 0644]
spec/google/api_client/auth/storages/file_store_spec.rb [new file with mode: 0644]

diff --git a/spec/google/api_client/auth/file_storage_spec.rb b/spec/google/api_client/auth/file_storage_spec.rb
deleted file mode 100644 (file)
index d3bcc3b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-require_relative '../../../../lib/google/api_client'
-require_relative '../../../../lib/google/api_client/auth/storage'
-
-describe Google::APIClient::FileStorage do
-  let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
-  let(:root_path) { File.expand_path(File.join(__FILE__, '..', '..', '..')) }
-  let(:json_file) { File.expand_path(File.join(root_path, 'fixtures', 'files', 'credentials.json')) }
-
-  #file_storage = Google::APIClient::FileStorage.new(CREDENTIAL_STORE_FILE)
-  #if file_storage.authorization.nil?
-  #  client_secrets = Google::APIClient::ClientSecrets.load
-  it 'should initialize' do
-    Google::APIClient::FileStorage.any_instance.should_receive(:load_credentials)
-    file_storage = Google::APIClient::FileStorage.new(json_file)
-    file_storage.path.to_s.should == json_file
-  end
-
-  it 'should load_credentials' do
-    Google::APIClient::FileStorage.any_instance.should_receive(:load_credentials)
-
-    file_storage = Google::APIClient::FileStorage.new(json_file)
-    file_storage.path.to_s.should == json_file
-  end
-
-end
diff --git a/spec/google/api_client/auth/storage_spec.rb b/spec/google/api_client/auth/storage_spec.rb
new file mode 100644 (file)
index 0000000..c6d3c3e
--- /dev/null
@@ -0,0 +1,38 @@
+require 'spec_helper'
+require_relative '../../../../lib/google/api_client'
+require_relative '../../../../lib/google/api_client/auth/storage'
+
+describe Google::APIClient::Storage do
+  let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
+  let(:root_path) { File.expand_path(File.join(__FILE__, '..', '..', '..')) }
+  let(:json_file) { File.expand_path(File.join(root_path, 'fixtures', 'files', 'auth_stored_credentials.json')) }
+
+  it 'should initialize'
+
+  describe 'authorize' do
+    it 'should authorize'
+  end
+
+
+  describe 'write_credentials' do
+
+    it 'should store credentials to var'
+
+    it 'should call store to write credentials'
+
+    it 'should not call store to write credentials'
+
+  end
+
+  describe 'refresh_authorization' do
+
+    it 'should call refresh and write credentials'
+
+  end
+
+  describe 'load_credentials' do
+    it 'should call store to load credentials'
+
+  end
+
+end
diff --git a/spec/google/api_client/auth/storages/file_store_spec.rb b/spec/google/api_client/auth/storages/file_store_spec.rb
new file mode 100644 (file)
index 0000000..cd7dbc9
--- /dev/null
@@ -0,0 +1,13 @@
+require 'spec_helper'
+require_relative '../../../../../lib/google/api_client/auth/storages/file_store'
+
+describe Google::APIClient::FileStore do
+  let(:client) { Google::APIClient.new(:application_name => 'API Client Tests') }
+  let(:root_path) { File.expand_path(File.join(__FILE__, '..', '..', '..')) }
+  let(:json_file) { File.expand_path(File.join(root_path, 'fixtures', 'files', 'auth_stored_credentials.json')) }
+
+  it 'should initialize'
+
+  it 'should load_credentials'
+
+end