From cb4e1400aa45f5d9781f62c028005782c0208ac3 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Wed, 8 Feb 2017 17:09:56 -0800 Subject: [PATCH] (POOLER-73) Modify spec tests for _check_running_vm Modify spec tests for _check_running_vm --- spec/unit/pool_manager_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/unit/pool_manager_spec.rb b/spec/unit/pool_manager_spec.rb index 8dc0d4c..34838d4 100644 --- a/spec/unit/pool_manager_spec.rb +++ b/spec/unit/pool_manager_spec.rb @@ -399,12 +399,10 @@ EOT end describe '#_check_running_vm' do - let(:pool_helper) { double('pool') } - let(:vsphere) { {pool => pool_helper} } + let(:vsphere) { double('vsphere') } before do expect(subject).not_to be_nil - $vsphere = vsphere end before(:each) do @@ -421,7 +419,9 @@ EOT context 'valid host' do 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(vm_host).to receive(:runtime).and_return true allow(vm_host).to receive_message_chain(:runtime, :powerState).and_return 'poweredOff'