1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

cleanup aws server specs and extract some to shared examples

This commit is contained in:
Wesley Beary 2010-01-09 12:22:45 -08:00
parent e60446bcbf
commit f61d47ee26
4 changed files with 84 additions and 112 deletions

View file

@ -0,0 +1,43 @@
shared_examples_for "Server" do
describe "#destroy" do
it "should return true if the server is deleted" do
subject.save
subject.destroy.should be_true
end
end
describe "#reload" do
it "should reset attributes to remote state" do
subject.save
eventually do
@reloaded = subject.reload
end
subject.attributes.should == @reloaded.attributes
end
end
describe "#save" do
it "should return true when it succeeds" do
subject.save.should be_true
end
it "should not exist remotely before save" do
@servers.get(subject.id).should be_nil
end
it "should exist remotely after save" do
subject.save
eventually do
@servers.get(subject.id).should_not be_nil
end
end
end
end