summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colson <joshua.colson@gmail.com>2019-02-19 08:44:10 -0700
committerJoshua Colson <joshua.colson@gmail.com>2019-02-19 08:44:10 -0700
commitb42e11f11013d52fed2e8328297e2f76922478c7 (patch)
treed44392f0801ec990d623a3bc77c082a72512a5ea
parent0ab406d69712a4116b7ec11930bf14131d61b181 (diff)
downloadohai-b42e11f11013d52fed2e8328297e2f76922478c7.tar.gz
fix for rspec failure due to :which method
Signed-off-by: Joshua Colson <joshua.colson@gmail.com>
-rw-r--r--lib/ohai/plugins/vbox_host.rb2
-rw-r--r--spec/unit/plugins/vbox_host_spec.rb1
2 files changed, 1 insertions, 2 deletions
diff --git a/lib/ohai/plugins/vbox_host.rb b/lib/ohai/plugins/vbox_host.rb
index 4dfeeb2a..b78047ee 100644
--- a/lib/ohai/plugins/vbox_host.rb
+++ b/lib/ohai/plugins/vbox_host.rb
@@ -154,7 +154,6 @@ Ohai.plugin(:VboxHost) do
# collect the data for a virtualization host running VirtualBox
collect_data(:default) do
- # vbox = Mash.new
ostypes = "ostypes"
guests = "guests"
natnets = "natnets"
@@ -167,7 +166,6 @@ Ohai.plugin(:VboxHost) do
hostfloppies = "hostfloppies"
if vbox_host?
- # virtualization[vbox] = Mash.new unless virtualization[vbox]
vbox Mash.new unless vbox
# get a list of virtualbox virtual hard disk drives
diff --git a/spec/unit/plugins/vbox_host_spec.rb b/spec/unit/plugins/vbox_host_spec.rb
index da623349..b030d31a 100644
--- a/spec/unit/plugins/vbox_host_spec.rb
+++ b/spec/unit/plugins/vbox_host_spec.rb
@@ -302,6 +302,7 @@ describe Ohai::System, "plugin vbox_host" do
plugin[:virtualization] = Mash.new
plugin[:virtualization][:systems] = Mash.new
plugin[:virtualization][:systems][:vbox] = "host"
+ allow(plugin).to receive(:which).with("VBoxManage").and_return("/usr/bin/VBoxManage")
allow(plugin).to receive(:shell_out).with("VBoxManage list --sorted ostypes").and_return(mock_shell_out(0, vbox_list_ostypes_stdout, ""))
allow(plugin).to receive(:shell_out).with("VBoxManage list --sorted vms").and_return(mock_shell_out(0, vbox_list_vms_stdout, ""))
allow(plugin).to receive(:shell_out).with("VBoxManage showvminfo 6294f16b-4f05-4430-afb9-773bdb237aec --machinereadable").and_return(mock_shell_out(0, vbox_vminfo_stdout, ""))