Sha256: 5afbe2a09157dc3bfec1b48047b22d902d0a0b89f9d8d680b0ae3216107ec6ce

Contents?: true

Size: 869 Bytes

Versions: 15

Compression:

Stored size: 869 Bytes

Contents

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

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

    before(:each) do
      @instance_id = ec2.run_instances('ami-5ee70037', 1, 1).body['instancesSet'].first['instanceId']
    end

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

    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

  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(Fog::Errors::BadRequest)
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fog-0.0.24 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.23 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.22 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.21 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.20 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.19 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.18 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.17 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.16 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.15 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.14 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.13 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.12 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.11 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.10 spec/aws/requests/ec2/get_console_output_spec.rb