2010-01-09 15:22:45 -05:00
|
|
|
shared_examples_for "Server" do
|
|
|
|
|
2010-01-13 01:00:49 -05:00
|
|
|
describe "#reboot" do
|
2010-01-09 15:22:45 -05:00
|
|
|
|
2010-01-13 01:00:49 -05:00
|
|
|
it "should succeed" do
|
2010-01-09 15:22:45 -05:00
|
|
|
subject.save
|
2010-01-13 01:00:49 -05:00
|
|
|
subject.wait_for { ready? }
|
|
|
|
subject.reboot.should be_true
|
2010-01-09 15:22:45 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#reload" do
|
|
|
|
|
|
|
|
it "should reset attributes to remote state" do
|
|
|
|
subject.save
|
2010-01-13 01:00:49 -05:00
|
|
|
subject.wait_for { ready? }
|
|
|
|
@reloaded = subject.reload
|
2010-01-09 15:22:45 -05:00
|
|
|
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
|
2010-01-13 01:00:49 -05:00
|
|
|
subject.wait_for { ready? }
|
|
|
|
@servers.get(subject.id).should_not be_nil
|
2010-01-09 15:22:45 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-01-31 20:33:47 -05:00
|
|
|
|