(POOLER-73) Add spec tests for get_vm_host_info

Add spec tests for get_vm_host_info
This commit is contained in:
Glenn Sarti 2017-02-10 13:08:15 -08:00
parent 14c091383c
commit e342cfe56a

View file

@ -920,6 +920,22 @@ EOT
end
end
describe "#get_vm_host_info" do
before do
expect(subject).not_to be_nil
end
let(:vm_object) { double('vm_object') }
let(:parent_host) { double('parent_host') }
it 'should return an array with host information' do
expect(vm_object).to receive_message_chain(:summary, :runtime, :host).and_return(parent_host)
expect(parent_host).to receive(:name).and_return('vmhostname')
expect(subject.get_vm_host_info(vm_object)).to eq([parent_host,'vmhostname'])
end
end
describe '#_check_pool' do
let(:pool_helper) { double('pool') }
let(:vsphere) { {pool => pool_helper} }