Sha256: f9f68c02fcee525044c6b74a479b62cb03fd43fce7149b9ff1a5cfefc90cccfe

Contents?: true

Size: 953 Bytes

Versions: 5

Compression:

Stored size: 953 Bytes

Contents

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

describe 'EC2.get_console_output' do
  describe 'success' do

    before(:each) do
      @instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
      AWS[:ec2].servers.get(@instance_id).wait_for { ready? }
    end

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

    it "should return proper attributes" do
      actual = AWS[: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

  end
  describe 'failure' do

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

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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