diff options
-rw-r--r-- | lib/facter/virtual.rb | 2 | ||||
-rw-r--r-- | spec/unit/virtual_spec.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb index 12269d2..468ab77 100644 --- a/lib/facter/virtual.rb +++ b/lib/facter/virtual.rb @@ -98,7 +98,7 @@ Facter.add("virtual") do end end end - # VMware server 1.0.3 rpm places vmware-vmx in this place, other versions or platforms may not. + if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx") result = "vmware_server" end diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb index f5a5c3c..7e50847 100644 --- a/spec/unit/virtual_spec.rb +++ b/spec/unit/virtual_spec.rb @@ -70,10 +70,12 @@ describe "Virtual fact" do end describe "on Linux" do + before do - Facter.fact(:architecture).stubs(:value).returns(true) + FileTest.expects(:exists?).with("/usr/lib/vmware/bin/vmware-vmx").returns false + Facter.fact(:architecture).stubs(:value).returns(true) end - + it "should be parallels with Parallels vendor id from lspci" do Facter.fact(:kernel).stubs(:value).returns("Linux") Facter::Util::Resolution.stubs(:exec).with('lspci').returns("01:00.0 VGA compatible controller: Unknown device 1ab8:4005") |