From 02485b6f7049fd09c961c87827f95fc394aa3b4e Mon Sep 17 00:00:00 2001 From: Hristo Paskalev Date: Wed, 14 Oct 2020 11:42:57 +0300 Subject: [PATCH] Added test scenario for missing VBoxManage on usability check of VirtualBox provider --- test/unit/plugins/providers/virtualbox/provider_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/plugins/providers/virtualbox/provider_test.rb b/test/unit/plugins/providers/virtualbox/provider_test.rb index 5e3dedda2..dabe45369 100644 --- a/test/unit/plugins/providers/virtualbox/provider_test.rb +++ b/test/unit/plugins/providers/virtualbox/provider_test.rb @@ -63,6 +63,14 @@ describe VagrantPlugins::ProviderVirtualBox::Provider do expect { subject.usable?(true) }. to raise_error(Vagrant::Errors::VirtualBoxInstallIncomplete) end + + it "raises an exception if VBoxManage is not found" do + allow(VagrantPlugins::ProviderVirtualBox::Driver::Meta).to receive(:new). + and_raise(Vagrant::Errors::VBoxManageNotFoundError) + + expect { subject.usable?(true) }. + to raise_error(Vagrant::Errors::VBoxManageNotFoundError) + end end describe "#driver" do