Sha256: fd775c743be23a8a192e66a4d9de5de93d7bdcccb943cb09158b9df7f351bcd7

Contents?: true

Size: 1019 Bytes

Versions: 11

Compression:

Stored size: 1019 Bytes

Contents

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

describe 'Rackspace::Files.delete_object' do
  describe 'success' do

    before(:each) do
      files.put_container('container_name')
      files.put_object('container_name', 'object_name', lorem_file)
    end
    
    after(:each) do
      files.delete_container('container_name')
    end

    it "should return proper attributes" do
      files.delete_object('container_name', 'object_name')
    end

  end
  describe 'failure' do

    it "should raise a NotFound error if the container does not exist" do
      lambda do
        files.delete_object('container_name', 'object_name')
      end.should raise_error(Excon::Errors::NotFound)
    end

    it "should raise a NotFound error if the object does not exist" do
      files.put_container('container_name')
      lambda do
        files.delete_object('container_name', 'object_name')
      end.should raise_error(Excon::Errors::NotFound)
      files.delete_container('container_name')
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-0.0.40 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.39 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.38 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.37 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.36 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.35 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.34 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.33 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.32 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.31 spec/rackspace/requests/files/delete_object_spec.rb
fog-0.0.30 spec/rackspace/requests/files/delete_object_spec.rb