(POOLER-73) Modify spec tests for _check_running_vm

Modify spec tests for _check_running_vm
This commit is contained in:
Glenn Sarti 2017-02-08 17:09:56 -08:00
parent 58175dec47
commit cb4e1400aa

View file

@ -399,12 +399,10 @@ EOT
end end
describe '#_check_running_vm' do describe '#_check_running_vm' do
let(:pool_helper) { double('pool') } let(:vsphere) { double('vsphere') }
let(:vsphere) { {pool => pool_helper} }
before do before do
expect(subject).not_to be_nil expect(subject).not_to be_nil
$vsphere = vsphere
end end
before(:each) do before(:each) do
@ -421,7 +419,9 @@ EOT
context 'valid host' do context 'valid host' do
let(:vm_host) { double('vmhost') } let(:vm_host) { double('vmhost') }
it 'does not move vm when not poweredOn' do it 'should not move VM when not poweredOn' do
# I'm not sure this test is useful. There is no codepath
# in _check_running_vm that looks at Power State
allow(vsphere).to receive(:find_vm).and_return vm_host allow(vsphere).to receive(:find_vm).and_return vm_host
allow(vm_host).to receive(:runtime).and_return true allow(vm_host).to receive(:runtime).and_return true
allow(vm_host).to receive_message_chain(:runtime, :powerState).and_return 'poweredOff' allow(vm_host).to receive_message_chain(:runtime, :powerState).and_return 'poweredOff'