[train] filling in pending rackspace files specs

This commit is contained in:
Wesley Beary 2009-11-05 09:24:58 -08:00
Родитель d220e9029b
Коммит 4225565218
6 изменённых файлов: 63 добавлений и 9 удалений

Просмотреть файл

@ -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