Sha256: 1e3bbf7665d866e042440bf0667ea75648262d23bad5a57fee11d56f3d954de4

Contents?: true

Size: 766 Bytes

Versions: 5

Compression:

Stored size: 766 Bytes

Contents

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

describe 'EC2.reboot_instances' 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.reboot_instances(@instance_id)
      actual.body['requestId'].should be_a(String)
      [false, true].should include(actual.body['return'])
    end

  end
  describe 'failure' do

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

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-0.0.29 spec/aws/requests/ec2/reboot_instances_spec.rb
fog-0.0.28 spec/aws/requests/ec2/reboot_instances_spec.rb
fog-0.0.27 spec/aws/requests/ec2/reboot_instances_spec.rb
fog-0.0.26 spec/aws/requests/ec2/reboot_instances_spec.rb
fog-0.0.25 spec/aws/requests/ec2/reboot_instances_spec.rb