Sha256: 0771012b7b63d92179011f4bf55a9eaaaac1c5cb335a2309cfb156147f453eee

Contents?: true

Size: 941 Bytes

Versions: 7

Compression:

Stored size: 941 Bytes

Contents

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

describe 'EC2.delete_snapshot' do
  describe 'success' do

    before(:each) do
      @volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
      @snapshot_id = AWS[:ec2].create_snapshot(@volume_id).body['snapshotId']
    end

    after(:each) do
      AWS[:ec2].delete_volume(@volume_id)
    end

    it "should return proper attributes" do
      AWS[:ec2].snapshots.get(@snapshot_id).wait_for { ready? }
      actual = AWS[:ec2].delete_snapshot(@snapshot_id)
      unless actual.body.empty?
        actual.body['requestId'].should be_a(String)
        [false, true].should include(actual.body['return'])
      end
    end

  end
  describe 'failure' do

    it "should raise a BadRequest error if snapshot does not exist" do
      lambda {
        AWS[:ec2].release_address('snap-00000000')
      }.should raise_error(Excon::Errors::BadRequest)
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-0.0.91 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.90 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.89 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.88 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.87 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.86 spec/aws/requests/ec2/delete_snapshot_spec.rb
fog-0.0.85 spec/aws/requests/ec2/delete_snapshot_spec.rb