From e6be5bfb75448f7d6ed8728cd838e5e1bfd6b6d2 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 13 Feb 2017 20:17:06 -0800 Subject: [PATCH] (POOLER-73) Add spec tests for create_vm_snapshot Add spec tests for create_vm_snapshot --- 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 cda2ff7..1be23d1 100644 --- a/spec/unit/pool_manager_spec.rb +++ b/spec/unit/pool_manager_spec.rb @@ -923,6 +923,22 @@ EOT end end + describe '#create_vm_snapshot' do + let(:vsphere) { double('vsphere') } + let(:snapshot_name) { 'snapshot' } + + before do + expect(subject).not_to be_nil + end + + it 'calls _create_vm_snapshot' do + expect(Thread).to receive(:new).and_yield + expect(subject).to receive(:_create_vm_snapshot).with(vm, snapshot_name, vsphere) + + subject.create_vm_snapshot(vm, snapshot_name, vsphere) + end + end + describe "#get_vm_host_info" do before do expect(subject).not_to be_nil