Sha256: fed647ac7a068ff8675ac15a276619435c413648657767481ec6f277afc8e268

Contents?: true

Size: 877 Bytes

Versions: 9

Compression:

Stored size: 877 Bytes

Contents

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

describe 'Rackspace::Servers.list_addresses' do
  describe 'success' do

    before(:each) do
      # flavor 1 = 256, image 3 = gentoo 2008.0
      @server_id = servers.create_server(1, 3, 'name').body['server']['id']
    end

    after(:each) do
      eventually(128) do
        servers.delete_server(@server_id)
      end
    end

    it "should return proper attributes" do
      actual = servers.list_addresses(@server_id).body
      actual['addresses'].should be_a(Hash)
      actual['addresses']['private'].should be_an(Array)
      actual['addresses']['public'].should be_an(Array)
    end

  end
  describe 'failure' do

    it "should raise a NotFound error if the server does not exist" do
      lambda {
        servers.list_addresses(0)
      }.should raise_error(Excon::Errors::NotFound)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fog-0.0.40 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.39 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.38 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.37 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.36 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.35 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.34 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.33 spec/rackspace/requests/servers/list_addresses_spec.rb
fog-0.0.32 spec/rackspace/requests/servers/list_addresses_spec.rb