From 7441b32f9e062f9ca73c9d452f0559aa866e0277 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Wed, 6 Apr 2011 03:04:02 +1000 Subject: Partial fix for #6971 - Fix for virtual tests --- spec/unit/virtual_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb index d169192..f69c898 100644 --- a/spec/unit/virtual_spec.rb +++ b/spec/unit/virtual_spec.rb @@ -73,6 +73,7 @@ describe "Virtual fact" do before do FileTest.expects(:exists?).with("/usr/lib/vmware/bin/vmware-vmx").returns false + Facter.fact(:operatingsystem).stubs(:value).returns(true) Facter.fact(:architecture).stubs(:value).returns(true) end @@ -127,7 +128,7 @@ describe "Virtual fact" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) - Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: VMware, Inc. VMware Virtual Platform") + Facter::Util::Resolution.stubs(:exec).with('prtdiag', '/bin/sh').returns("System Configuration: VMware, Inc. VMware Virtual Platform") Facter.fact(:virtual).value.should == "vmware" end @@ -135,7 +136,7 @@ describe "Virtual fact" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) - Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: Parallels Virtual Platform") + Facter::Util::Resolution.stubs(:exec).with('prtdiag', '/bin/sh').returns("System Configuration: Parallels Virtual Platform") Facter.fact(:virtual).value.should == "parallels" end @@ -143,7 +144,7 @@ describe "Virtual fact" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) - Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: innotek GmbH VirtualBox") + Facter::Util::Resolution.stubs(:exec).with('prtdiag', '/bin/sh').returns("System Configuration: innotek GmbH VirtualBox") Facter.fact(:virtual).value.should == "virtualbox" end end -- cgit