Sha256: c11f5d32120f6ab7c0f680fbf859f119812de06550597491ef5485475d2ec939

Contents?: true

Size: 1015 Bytes

Versions: 2

Compression:

Stored size: 1015 Bytes

Contents

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

describe 'EC2.attach_volume' do

  before(:all) do
    @ec2 = Fog::AWS::EC2.gen
    @instance_id = @ec2.run_instances('ami-5ee70037', 1, 1, {'Placement.AvailabilityZone' => 'us-east-1a'}).body['instancesSet'].first['instanceId']
    @volume_id = @ec2.create_volume('us-east-1a', 1).body['volumeId']
  end

  after(:all) do
    eventually do
      @ec2.detach_volume(@volume_id)
    end
    eventually do
      @ec2.delete_volume(@volume_id)
      @ec2.terminate_instances([@instance_id])
    end
  end

  it "should return proper attributes" do
    eventually(128) do
      actual = @ec2.attach_volume(@volume_id, @instance_id, '/dev/sdh')
      actual.body['attachTime'].should be_a(Time)
      actual.body['device'].should be_a(String)
      actual.body['instanceId'].should be_a(String)
      actual.body['requestId'].should be_a(String)
      actual.body['status'].should be_a(String)
      actual.body['volumeId'].should be_a(String)
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geemus-fog-0.0.1 spec/aws/requests/ec2/attach_volume_spec.rb
geemus-fog-0.0.3 spec/aws/requests/ec2/attach_volume_spec.rb