1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/spec/aws/ec2/run_instances_spec.rb

40 lines
1.5 KiB
Ruby
Raw Normal View History

2009-07-09 00:58:02 -04:00
require File.dirname(__FILE__) + '/../../spec_helper'
describe 'EC2.run_instances' do
after(:all) do
ec2.terminate_instances([@instance_id])
end
2009-07-09 00:58:02 -04:00
it "should return proper attributes" do
actual = ec2.run_instances('ami-5ee70037', 1, 1)
@instance_id = actual.body[:instances_set].first[:instance_id]
actual.body[:group_set].should be_an(Array)
actual.body[:group_set].first.should be_a(String)
actual.body[:instances_set].should be_an(Array)
instance = actual.body[:instances_set].first
instance[:ami_launch_index].should be_a(Integer)
instance[:dns_name].should be_a(String)
instance[:image_id].should be_a(String)
instance[:instance_id].should be_a(String)
instance[:instance_state].should be_an(Hash)
instance[:instance_state][:code].should be_an(Integer)
instance[:instance_state][:name].should be_an(String)
instance[:instance_type].should be_a(String)
instance[:kernel_id].should be_a(String)
# instance[:key_name].should be_a(String)
instance[:launch_time].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][:availability_zone].should be_a(String)
instance[:private_dns_name].should be_a(String)
instance[:ramdisk_id].should be_a(String)
instance[:reason].should be_a(String)
actual.body[:owner_id].should be_a(String)
actual.body[:request_id].should be_a(String)
actual.body[:reservation_id].should be_a(String)
2009-07-09 00:58:02 -04:00
end
end