mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[train] filling in pending rackspace files specs
This commit is contained in:
parent
d220e9029b
commit
4225565218
6 changed files with 63 additions and 9 deletions
|
@ -19,6 +19,13 @@ unless Fog.mocking?
|
|||
# * headers<~Hash>:
|
||||
# * 'X-Account-Container-Count'<~String> - Count of containers
|
||||
# * 'X-Account-Bytes-Used'<~String> - Bytes used
|
||||
# * body<~Array>:
|
||||
# * item<~Hash>:
|
||||
# * 'bytes'<~String> - Size of object
|
||||
# * 'content_type'<~String> Content-Type of object
|
||||
# * 'hash'<~String> - Hash of object (etag?)
|
||||
# * 'last_modified'<~String> - Last modified timestamp
|
||||
# * 'name'<~String> - Name of object
|
||||
def get_container(container, options = {})
|
||||
query = ''
|
||||
for key, value in options.merge!({ 'format' => 'json' })
|
||||
|
|
|
@ -3,9 +3,17 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|||
describe 'Rackspace::Files.delete_object' do
|
||||
describe 'success' do
|
||||
|
||||
before(:each) do
|
||||
files.put_container('container_name')
|
||||
files.put_object('container_name', 'object_name', lorem_file)
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
files.delete_container('container_name')
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
pending
|
||||
p files.delete_object(container_name, object_name)
|
||||
files.delete_object('container_name', 'object_name')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,9 +3,23 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|||
describe 'Rackspace::Files.get_container' do
|
||||
describe 'success' do
|
||||
|
||||
before(:each) do
|
||||
files.put_container('container_name')
|
||||
files.put_object('container_name', 'object_name', lorem_file)
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
files.delete_object('container_name', 'object_name')
|
||||
files.delete_container('container_name')
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
pending
|
||||
files.get_container(container_name)
|
||||
actual = files.get_container('container_name').body
|
||||
actual.first['bytes'].should be_an(Integer)
|
||||
actual.first['content_type'].should be_a(String)
|
||||
actual.first['hash'].should be_a(String)
|
||||
actual.first['last_modified'].should be_a(String)
|
||||
actual.first['name'].should be_a(String)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,9 +3,18 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|||
describe 'Rackspace::Files.head_container' do
|
||||
describe 'success' do
|
||||
|
||||
before(:each) do
|
||||
files.put_container('container_name')
|
||||
files.put_object('container_name', 'object_name', lorem_file)
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
files.delete_object('container_name', 'object_name')
|
||||
files.delete_container('container_name')
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
pending
|
||||
p files.head_container(container_name)
|
||||
files.head_container('container_name')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,8 +3,16 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|||
describe 'Rackspace::Files.head_containers' do
|
||||
describe 'success' do
|
||||
|
||||
before(:each) do
|
||||
files.put_container('container_name')
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
files.delete_container('container_name')
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
p files.head_containers
|
||||
files.head_containers
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,9 +3,17 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|||
describe 'Rackspace::Files.put_object' do
|
||||
describe 'success' do
|
||||
|
||||
before(:each) do
|
||||
files.put_container('container_name')
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
files.delete_object('object_name')
|
||||
files.delete_container('container_name')
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
pending
|
||||
p files.put_object(container_name, object_name, data)
|
||||
files.put_object('container_name', 'object_name', lorem_file)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue