- Looks like some copy/paste added some linux tests that relied on
   prtdiag, which isn't possible. Corrected them to check against
   solaris.

Signed-off-by: Adrien Thebo <adr...@puppetlabs.com>
---
Local-branch: tickets/next/2714
 spec/unit/virtual_spec.rb |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index 7e50847..62075a7 100644
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -107,22 +107,24 @@ describe "Virtual fact" do
           Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On 
Board Device Information\nType: Video\nStatus: Disabled\nDescription: Parallels 
Video Adapter")
           Facter.fact(:virtual).value.should == "parallels"
       end
+  end
 
-      it "should be vmware with VMWare vendor name from prtdiag" do
-          Facter.fact(:kernel).stubs(:value).returns("Linux")
-          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.fact(:virtual).value.should == "vmware"
-      end
+  describe "on Solaris" do
+    it "should be vmware with VMWare vendor name from prtdiag" 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', 
'/bin/sh').returns("System Configuration: VMware, Inc. VMware Virtual Platform")
+        Facter.fact(:virtual).value.should == "vmware"
+    end
 
-      it "should be parallels with Parallels vendor name from prtdiag" do
-          Facter.fact(:kernel).stubs(:value).returns("Linux")
-          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.fact(:virtual).value.should == "parallels"
-      end
+    it "should be parallels with Parallels vendor name from prtdiag" 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', 
'/bin/sh').returns("System Configuration: Parallels Virtual Platform")
+        Facter.fact(:virtual).value.should == "parallels"
+    end
   end
 end
 
-- 
1.7.4.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to