diff options
author | James Turnbull <james@lovedthanlost.net> | 2011-04-06 03:04:02 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2011-04-06 03:04:02 +1000 |
commit | 7441b32f9e062f9ca73c9d452f0559aa866e0277 (patch) | |
tree | b84d8940457e55d99205bbe348515f20888f9e69 /spec | |
parent | 68a125c56b65ecadcbe92ecb4bafb28731706e57 (diff) | |
download | facter-7441b32f9e062f9ca73c9d452f0559aa866e0277.tar.gz facter-7441b32f9e062f9ca73c9d452f0559aa866e0277.tar.xz facter-7441b32f9e062f9ca73c9d452f0559aa866e0277.zip |
Partial fix for #6971 - Fix for virtual tests
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/virtual_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 |