mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
test and fix server question methods
This commit is contained in:
parent
fbb122e56c
commit
360fa1278f
2 changed files with 23 additions and 3 deletions
|
@ -33,17 +33,17 @@ module Fog
|
|||
|
||||
def ready?
|
||||
load_unless_loaded!
|
||||
@status == '2'
|
||||
status == '2'
|
||||
end
|
||||
|
||||
def on?
|
||||
load_unless_loaded!
|
||||
@status == '4'
|
||||
status == '4'
|
||||
end
|
||||
|
||||
def off?
|
||||
load_unless_loaded!
|
||||
@status == '2'
|
||||
status == '2'
|
||||
end
|
||||
|
||||
def power_on
|
||||
|
|
|
@ -26,6 +26,26 @@ if Fog.mocking?
|
|||
its(:cpus) { should == { :count => @mock_vm.cpus, :units => nil } }
|
||||
its(:memory) { should == { :amount => @mock_vm.memory, :units => nil } }
|
||||
its(:disks) { should == @mock_vm.to_configure_vapp_hash[:disks] }
|
||||
|
||||
describe "question methods" do
|
||||
describe "#ready?" do
|
||||
before { subject.power_off }
|
||||
|
||||
it { should be_ready }
|
||||
end
|
||||
|
||||
describe "#on?" do
|
||||
before { subject.power_on }
|
||||
|
||||
it { should be_on }
|
||||
end
|
||||
|
||||
describe "#off?" do
|
||||
before { subject.power_off }
|
||||
|
||||
it { should be_off }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "as a new server without all info" do
|
||||
|
|
Loading…
Reference in a new issue