From e342cfe56ac6a356d8e0aee7eaba7391ad2e3a56 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 10 Feb 2017 13:08:15 -0800 Subject: [PATCH] (POOLER-73) Add spec tests for get_vm_host_info Add spec tests for get_vm_host_info --- spec/unit/pool_manager_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/unit/pool_manager_spec.rb b/spec/unit/pool_manager_spec.rb index 854c838..d89b82b 100644 --- a/spec/unit/pool_manager_spec.rb +++ b/spec/unit/pool_manager_spec.rb @@ -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} }