Sha256: 7169c4726a85814528fc0d0f4a87f7b26e75f14571f80bace0c5f2757e9cdc45

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'

describe 'Storage.delete_bucket' do
  describe 'success' do

    before(:each) do
      Google[:storage].put_bucket('fogdeletebucket')
    end

    it 'should return proper attributes' do
      actual = Google[:storage].delete_bucket('fogdeletebucket')
      actual.status.should == 204
    end

  end
  describe 'failure' do

    it 'should raise a NotFound error if the bucket does not exist' do
      lambda {
        Google[:storage].delete_bucket('fognotabucket')
      }.should raise_error(Excon::Errors::NotFound)
    end

    it 'should raise a Conflict error if the bucket is not empty' do
      Google[:storage].put_bucket('fogdeletebucket')
      Google[:storage].put_object('fogdeletebucket', 'fog_delete_object', lorem_file)
      lambda {
        Google[:storage].delete_bucket('fogdeletebucket')
      }.should raise_error(Excon::Errors::Conflict)
      Google[:storage].delete_object('fogdeletebucket', 'fog_delete_object')
      Google[:storage].delete_bucket('fogdeletebucket')
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fog-0.3.17 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.16 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.15 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.14 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.13 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.12 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.11 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.10 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.9 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.8 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.7 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.6 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.5 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.4 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.3 spec/google/requests/storage/delete_bucket_spec.rb
fog-0.3.2 spec/google/requests/storage/delete_bucket_spec.rb