diff --git a/lib/fog/rackspace/requests/files/get_container.rb b/lib/fog/rackspace/requests/files/get_container.rb index bbc040579..d14d0a756 100644 --- a/lib/fog/rackspace/requests/files/get_container.rb +++ b/lib/fog/rackspace/requests/files/get_container.rb @@ -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' }) diff --git a/spec/rackspace/requests/files/delete_object_spec.rb b/spec/rackspace/requests/files/delete_object_spec.rb index 0533058c1..9dcb81029 100644 --- a/spec/rackspace/requests/files/delete_object_spec.rb +++ b/spec/rackspace/requests/files/delete_object_spec.rb @@ -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 diff --git a/spec/rackspace/requests/files/get_container_spec.rb b/spec/rackspace/requests/files/get_container_spec.rb index 49c57ffe1..d1b1c9100 100644 --- a/spec/rackspace/requests/files/get_container_spec.rb +++ b/spec/rackspace/requests/files/get_container_spec.rb @@ -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 diff --git a/spec/rackspace/requests/files/head_container_spec.rb b/spec/rackspace/requests/files/head_container_spec.rb index c8878114d..88af4bd5b 100644 --- a/spec/rackspace/requests/files/head_container_spec.rb +++ b/spec/rackspace/requests/files/head_container_spec.rb @@ -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 diff --git a/spec/rackspace/requests/files/head_containers_spec.rb b/spec/rackspace/requests/files/head_containers_spec.rb index e0fff43af..8a342052a 100644 --- a/spec/rackspace/requests/files/head_containers_spec.rb +++ b/spec/rackspace/requests/files/head_containers_spec.rb @@ -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 diff --git a/spec/rackspace/requests/files/put_object_spec.rb b/spec/rackspace/requests/files/put_object_spec.rb index e4599f7db..ab37543b3 100644 --- a/spec/rackspace/requests/files/put_object_spec.rb +++ b/spec/rackspace/requests/files/put_object_spec.rb @@ -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