2009-08-17 15:55:30 -07:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2010-09-09 17:50:38 -07:00
|
|
|
describe 'Storage.get_bucket_location' do
|
2009-08-19 20:32:57 -07:00
|
|
|
describe 'success' do
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 20:32:57 -07:00
|
|
|
before(:each) do
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].put_bucket('foggetlocation', 'LocationConstraint' => 'EU')
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 20:32:57 -07:00
|
|
|
after(:each) do
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:eu_storage].delete_bucket('foggetlocation')
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
it 'should return proper attributes' do
|
2010-09-09 17:50:38 -07:00
|
|
|
actual = AWS[:storage].get_bucket_location('foggetlocation')
|
2009-08-19 19:11:57 -07:00
|
|
|
actual.status.should == 200
|
|
|
|
actual.body['LocationConstraint'].should == 'EU'
|
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-16 13:31:36 -07:00
|
|
|
end
|
2009-08-19 20:32:57 -07:00
|
|
|
describe 'failure' do
|
2009-08-16 13:31:36 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
it 'should raise NotFound error if bucket does not exist' do
|
|
|
|
lambda {
|
2010-09-09 17:50:38 -07:00
|
|
|
AWS[:storage].get_bucket_location('fognotabucket')
|
2009-10-31 12:26:49 -07:00
|
|
|
}.should raise_error(Excon::Errors::NotFound)
|
2009-08-19 19:11:57 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|