-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_examples.rb
More file actions
43 lines (30 loc) · 811 Bytes
/
Copy pathserver_examples.rb
File metadata and controls
43 lines (30 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
shared_examples_for "Server" do
describe "#reboot" do
it "should succeed" do
subject.save
subject.wait_for { ready? }
subject.reboot.should be_true
end
end
describe "#reload" do
it "should reset attributes to remote state" do
subject.save
subject.wait_for { ready? }
@reloaded = subject.reload
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
subject.wait_for { ready? }
@servers.get(subject.id).should_not be_nil
end
end
end