2009-11-01 23:34:00 -08:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
|
|
|
|
|
|
describe 'Rackspace::Files.get_container' do
|
|
|
|
describe 'success' do
|
|
|
|
|
2009-11-05 09:24:58 -08:00
|
|
|
before(:each) do
|
2010-01-23 12:35:16 -08:00
|
|
|
Rackspace[:files].put_container('container_name')
|
|
|
|
Rackspace[:files].put_object('container_name', 'object_name', lorem_file)
|
2009-11-05 09:24:58 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
after(:each) do
|
2010-01-23 12:35:16 -08:00
|
|
|
Rackspace[:files].delete_object('container_name', 'object_name')
|
|
|
|
Rackspace[:files].delete_container('container_name')
|
2009-11-05 09:24:58 -08:00
|
|
|
end
|
|
|
|
|
2009-11-01 23:34:00 -08:00
|
|
|
it "should return proper attributes" do
|
2010-01-23 12:35:16 -08:00
|
|
|
actual = Rackspace[:files].get_container('container_name').body
|
2009-11-05 09:24:58 -08:00
|
|
|
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)
|
2009-11-01 23:34:00 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-11-06 21:22:38 -08:00
|
|
|
describe 'failure' do
|
|
|
|
|
2009-11-14 16:45:52 -08:00
|
|
|
it "should not raise an if the container does not exist" do
|
2010-01-23 12:35:16 -08:00
|
|
|
Rackspace[:files].get_container('container_name')
|
2009-11-06 21:22:38 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-11-01 23:34:00 -08:00
|
|
|
end
|