Sha256: 039625b7e542bcd023edc0df592ee6bb06879118d69f271d53a9a0d79d6b8614

Contents?: true

Size: 867 Bytes

Versions: 11

Compression:

Stored size: 867 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(GENTOO_AMI, 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(Excon::Errors::BadRequest)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-0.0.40 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.39 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.38 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.37 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.36 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.35 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.34 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.33 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.32 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.31 spec/aws/requests/ec2/get_console_output_spec.rb
fog-0.0.30 spec/aws/requests/ec2/get_console_output_spec.rb