2009-08-17 15:55:30 -07:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-07-22 19:28:53 -07:00
|
|
|
describe 'S3.get_bucket_location' do
|
2009-08-19 19:11:57 -07:00
|
|
|
describe 'success'
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
before(:all) do
|
|
|
|
s3.put_bucket('foggetlocation', 'LocationConstraint' => 'EU')
|
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
after(:all) do
|
|
|
|
eu_s3.delete_bucket('foggetlocation')
|
|
|
|
end
|
2009-06-25 00:32:27 -07:00
|
|
|
|
2009-08-19 19:11:57 -07:00
|
|
|
it 'should return proper attributes' do
|
|
|
|
actual = s3.get_bucket_location('foggetlocation')
|
|
|
|
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 19:11:57 -07:00
|
|
|
describe 'failure'
|
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 {
|
|
|
|
s3.get_bucket_location('fognotabucket')
|
|
|
|
}.should raise_error(Fog::Errors::NotFound)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|