2009-10-11 16:37:25 -04:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
|
|
|
2009-10-14 01:36:35 -04:00
|
|
|
describe 'Rackspace::Servers.delete_server' do
|
2009-10-11 16:37:25 -04:00
|
|
|
describe 'success' do
|
|
|
|
|
2009-10-18 21:11:19 -04:00
|
|
|
before(:each) do
|
|
|
|
# flavor 1 = 256, image 3 = gentoo 2008.0
|
|
|
|
@server_id = servers.create_server(1, 3).body['server']['id']
|
|
|
|
end
|
|
|
|
|
2009-10-11 16:37:25 -04:00
|
|
|
it "should return proper attributes" do
|
2009-11-04 00:46:27 -05:00
|
|
|
eventually do
|
2009-10-18 21:11:19 -04:00
|
|
|
servers.delete_server(@server_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
describe 'failure' do
|
|
|
|
|
|
|
|
it "should raise a NotFound error if the server does not exist" do
|
|
|
|
lambda {
|
|
|
|
servers.delete_server(0)
|
2009-10-31 15:26:49 -04:00
|
|
|
}.should raise_error(Excon::Errors::NotFound)
|
2009-10-11 16:37:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-10-14 01:36:35 -04:00
|
|
|
end
|