From: Daniel Pittman <dan...@rimspace.net>

We now clear the Facter cache in the spec_helper support code around every
test; this ensures that we consistently and correctly implement this without
having to repeat it in every single spec file.

Eliminating the manual flush helps stop people copying that around and
incorrectly perpetuating the problem.
---
 spec/unit/operatingsystem_spec.rb        |    9 ---------
 spec/unit/operatingsystemrelease_spec.rb |    9 ---------
 spec/unit/selinux_spec.rb                |    6 ------
 spec/unit/uptime_spec.rb                 |    3 ---
 spec/unit/util/manufacturer_spec.rb      |    4 ----
 spec/unit/util/virtual_spec.rb           |    4 ----
 spec/unit/virtual_spec.rb                |   10 ----------
 7 files changed, 0 insertions(+), 45 deletions(-)

diff --git a/spec/unit/operatingsystem_spec.rb 
b/spec/unit/operatingsystem_spec.rb
index be83916..37c9d16 100755
--- a/spec/unit/operatingsystem_spec.rb
+++ b/spec/unit/operatingsystem_spec.rb
@@ -5,15 +5,6 @@ require File.expand_path(File.dirname(__FILE__) + 
'/../spec_helper')
 require 'facter'
 
 describe "Operating System fact" do
-
-    before do
-        Facter.clear
-    end
-    
-    after do
-        Facter.clear
-    end
-    
     it "should default to the kernel name" do
         Facter.fact(:kernel).stubs(:value).returns("Nutmeg")
 
diff --git a/spec/unit/operatingsystemrelease_spec.rb 
b/spec/unit/operatingsystemrelease_spec.rb
index 1cfb4ac..45f177d 100755
--- a/spec/unit/operatingsystemrelease_spec.rb
+++ b/spec/unit/operatingsystemrelease_spec.rb
@@ -5,15 +5,6 @@ require File.expand_path(File.dirname(__FILE__) + 
'/../spec_helper')
 require 'facter'
 
 describe "Operating System Release fact" do
-
-    before do
-        Facter.clear
-    end
-
-    after do
-        Facter.clear
-    end
-
     test_cases = {
         "CentOS" => "/etc/redhat-release",
         "RedHat" => "/etc/redhat-release",
diff --git a/spec/unit/selinux_spec.rb b/spec/unit/selinux_spec.rb
index 43fd5bf..f197ae6 100755
--- a/spec/unit/selinux_spec.rb
+++ b/spec/unit/selinux_spec.rb
@@ -5,12 +5,6 @@ require File.expand_path(File.dirname(__FILE__) + 
'/../spec_helper')
 require 'facter'
 
 describe "SELinux facts" do
-
-
-    after do
-        Facter.clear
-    end
-
     it "should return true if SELinux enabled" do
         Facter.fact(:kernel).stubs(:value).returns("Linux")
 
diff --git a/spec/unit/uptime_spec.rb b/spec/unit/uptime_spec.rb
index bd695fa..f9b7af4 100755
--- a/spec/unit/uptime_spec.rb
+++ b/spec/unit/uptime_spec.rb
@@ -6,9 +6,6 @@ require 'facter'
 require 'facter/util/uptime'
 
 describe "uptime facts:" do
-  before { Facter.clear }
-  after { Facter.clear }
-
   describe "when uptime information is available" do
     describe "uptime" do
       test_cases = [
diff --git a/spec/unit/util/manufacturer_spec.rb 
b/spec/unit/util/manufacturer_spec.rb
index 07473db..579e790 100644
--- a/spec/unit/util/manufacturer_spec.rb
+++ b/spec/unit/util/manufacturer_spec.rb
@@ -3,10 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + 
'/../../spec_helper')
 require 'facter/util/manufacturer'
 
 describe Facter::Manufacturer do
-    before :each do
-        Facter.clear
-    end
-
     it "should return the system DMI table" do
         Facter::Manufacturer.should respond_to(:get_dmi_table)
     end
diff --git a/spec/unit/util/virtual_spec.rb b/spec/unit/util/virtual_spec.rb
index aa2de5a..0b934f4 100644
--- a/spec/unit/util/virtual_spec.rb
+++ b/spec/unit/util/virtual_spec.rb
@@ -3,10 +3,6 @@ require File.expand_path(File.dirname(__FILE__) + 
'/../../spec_helper')
 require 'facter/util/virtual'
 
 describe Facter::Util::Virtual do
-
-    after do
-        Facter.clear
-    end
     it "should detect openvz" do
         FileTest.stubs(:directory?).with("/proc/vz").returns(true)
         Facter::Util::Virtual.should be_openvz
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index a152b40..5555334 100644
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -5,11 +5,6 @@ require 'facter/util/virtual'
 require 'facter/util/macosx'
 
 describe "Virtual fact" do
-
-    after do
-        Facter.clear
-    end
-
   it "should be zone on Solaris when a zone" do
       Facter.fact(:kernel).stubs(:value).returns("SunOS")
       Facter::Util::Virtual.stubs(:zone?).returns(true)
@@ -118,11 +113,6 @@ describe "Virtual fact" do
 end
 
 describe "is_virtual fact" do
-
-    after do
-        Facter.clear
-    end
-
     it "should be virtual when running on xen" do
        Facter.fact(:kernel).stubs(:value).returns("Linux")
        Facter.fact(:virtual).stubs(:value).returns("xenu")
-- 
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