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/requests/ec2/get_console_output_spec.rb

33 lines
867 B
Ruby
Raw Normal View History

2009-08-17 15:55:30 -07:00
require File.dirname(__FILE__) + '/../../../spec_helper'
2009-07-24 19:25:55 -07:00
describe 'EC2.get_console_output' do
2009-08-19 20:32:57 -07:00
describe 'success' do
2009-07-24 19:25:55 -07:00
2009-08-19 20:32:57 -07:00
before(:each) do
@instance_id = ec2.run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
2009-08-19 20:32:57 -07:00
end
2009-07-24 19:25:55 -07:00
2009-08-19 20:32:57 -07:00
after(:each) do
ec2.terminate_instances([@instance_id])
end
2009-07-24 19:25:55 -07:00
2009-08-19 20:32:57 -07:00
it "should return proper attributes" do
actual = ec2.get_console_output(@instance_id)
actual.body['instanceId'].should be_a(String)
actual.body['output'].should be_a(String)
actual.body['requestId'].should be_a(String)
actual.body['timestamp'].should be_a(Time)
end
2009-07-24 19:25:55 -07:00
2009-08-19 20:32:57 -07:00
end
describe 'failure' do
it "should raise a BadRequest error if the instance does not exist" do
lambda {
ec2.get_console_output('i-00000000')
}.should raise_error(Excon::Errors::BadRequest)
end
end
2009-07-24 19:25:55 -07:00
end