Sha256: 73599ef16e8e50bce90710b3782a655280ea7a0ecd7be4416b648df0f186e0a5

Contents?: true

Size: 1.68 KB

Versions: 16

Compression:

Stored size: 1.68 KB

Contents

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

describe 'EC2.run_instances' do
  describe 'success' do

    after(:each) do
      ec2.terminate_instances(@instance_id)
    end

    it "should return proper attributes" do
      # ami-5ee70037 = gentoo
      actual = ec2.run_instances(GENTOO_AMI, 1, 1)
      @instance_id = actual.body['instancesSet'].first['instanceId']
      actual.body['groupSet'].should be_an(Array)
      actual.body['groupSet'].first.should be_a(String)
      actual.body['instancesSet'].should be_an(Array)
      instance = actual.body['instancesSet'].first
      instance['amiLaunchIndex'].should be_a(Integer)
      instance['dnsName'].should be_a(String)
      instance['imageId'].should be_a(String)
      instance['instanceId'].should be_a(String)
      instance['instanceState'].should be_an(Hash)
      instance['instanceState']['code'].should be_an(Integer)
      instance['instanceState']['name'].should be_an(String)
      instance['instanceType'].should be_a(String)
      instance['kernelId'].should be_a(String)
      instance['keyName'].should be_a(String) if instance['keyName']
      instance['launchTime'].should be_a(Time)
      instance['monitoring'].should be_a(Hash)
      [false, true].should include(instance['monitoring']['state'])
      instance['placement'].should be_a(Hash)
      instance['placement']['availabilityZone'].should be_a(String)
      instance['privateDnsName'].should be_a(String)
      instance['ramdiskId'].should be_a(String)
      instance['reason'].should be_a(String)
      actual.body['ownerId'].should be_a(String)
      actual.body['requestId'].should be_a(String)
      actual.body['reservationId'].should be_a(String)
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fog-0.0.40 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.39 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.38 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.37 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.36 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.35 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.34 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.33 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.32 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.31 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.30 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.29 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.28 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.27 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.26 spec/aws/requests/ec2/run_instances_spec.rb
fog-0.0.25 spec/aws/requests/ec2/run_instances_spec.rb