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