mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(POOLER-73) Add spec tests for get_vm_host_info
Add spec tests for get_vm_host_info
This commit is contained in:
parent
14c091383c
commit
e342cfe56a
1 changed files with 16 additions and 0 deletions
|
|
@ -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} }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue