[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:18:53 UTC 2011


The following commit has been merged in the experimental branch:
commit c63e9c2394a30fe653908cd15967218d90fa34d6
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Mon May 2 13:57:57 2011 -0700

    maint: reset more global state in testing faces...
    
    When we query for all faces we need to scan the entire Ruby load path, look
    for everything that looks like a face, and load it up.  That is a fairly
    expensive operation, especially on a platform that has slow I/O.
    
    *cough* EC2 *cough*
    
    Because of that we only scan once, and assume that the list is static
    thereafter; this works OK out in the field, but sucks in testing where that
    global state gets in the way of the rest of our fiddling under the hood.
    
    This resets the '@loaded' member of the collection additionally, which is what
    should be done since we have reset the rest of the collection at the same
    time.
    
    We don't bother to reset it, as an extra scan during tests is not a problem.
    
    Reviewed-By: Nick Lewis <nick at puppetlabs.com>

diff --git a/spec/unit/interface/face_collection_spec.rb b/spec/unit/interface/face_collection_spec.rb
index 890e06a..4358ef4 100755
--- a/spec/unit/interface/face_collection_spec.rb
+++ b/spec/unit/interface/face_collection_spec.rb
@@ -16,11 +16,12 @@ describe Puppet::Interface::FaceCollection do
     @original_faces    = subject.instance_variable_get("@faces").dup
     @original_required = $".dup
     $".delete_if do |path| path =~ %r{/face/.*\.rb$} end
-    subject.instance_variable_get("@faces").clear
+    subject.instance_variable_get(:@faces).clear
+    subject.instance_variable_set(:@loaded, false)
   end
 
   after :each do
-    subject.instance_variable_set("@faces", @original_faces)
+    subject.instance_variable_set(:@faces, @original_faces)
     $".clear ; @original_required.each do |item| $" << item end
   end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list