2011-02-17 13:44:46 -05:00
|
|
|
require 'ecloud/spec_helper'
|
2010-06-30 00:15:36 -04:00
|
|
|
|
|
|
|
if Fog.mocking?
|
|
|
|
#FIXME: with rspec2
|
2011-02-17 13:44:46 -05:00
|
|
|
describe "Fog::Ecloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
2010-06-30 00:15:36 -04:00
|
|
|
subject { @vcloud }
|
|
|
|
|
2011-02-15 16:47:14 -05:00
|
|
|
it { should respond_to(:delete_node) }
|
2010-06-30 00:15:36 -04:00
|
|
|
|
|
|
|
describe "#delete_node" do
|
|
|
|
context "with a valid node service uri" do
|
2010-10-17 19:06:44 -04:00
|
|
|
subject { @vcloud.delete_node(@mock_node.href) }
|
2010-06-30 00:15:36 -04:00
|
|
|
|
2010-10-17 19:06:44 -04:00
|
|
|
it_should_behave_like "all delete responses"
|
2010-06-30 00:15:36 -04:00
|
|
|
|
|
|
|
it "should change the count by -1" do
|
2010-10-17 19:06:44 -04:00
|
|
|
expect { subject }.to change { @vcloud.get_nodes(@mock_node_collection.href).body[:NodeService].length }.by(-1)
|
2010-06-30 00:15:36 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with a nodes uri that doesn't exist" do
|
|
|
|
subject { lambda { @vcloud.delete_node(URI.parse('https://www.fakey.c/piv8vc99')) } }
|
|
|
|
|
|
|
|
it_should_behave_like "a request for a resource that doesn't exist"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
end
|
|
|
|
|