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

Nick Lewis nick at puppetlabs.com
Tue May 10 08:03:47 UTC 2011


The following commit has been merged in the experimental branch:
commit 27abd84611564ac573c5fde8abb6b98e6bd3d9b7
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Fri Jan 7 13:49:23 2011 -0800

    maint: Stop stubbing 'use' on any_instance of Puppet::Util::Settings
    
    This is because of the fix for #5799, which means there will only be a single
    instance of Puppet::Util::Settings throughout the lifetime of the spec run.
    
    Paired-With: Paul Berry

diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb
index be39707..cee6a0d 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -293,14 +293,6 @@ describe Puppet::Application::Agent do
       @puppetd.setup
     end
 
-    it "mocha work-around" do
-      # Mocha 0.9.10 and earlier leaves behind a bogus "use" method
-      # See https://github.com/floehopper/mocha/issues#issue/20
-      class << Puppet.settings
-        remove_method :use rescue nil
-      end
-    end
-
     it "should install a remote ca location" do
       Puppet::SSL::Host.expects(:ca_location=).with(:remote)
 
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index 9485ed2..8aaa5d8 100755
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -177,7 +177,7 @@ describe Puppet::Application::Apply do
     describe "the main command" do
       before :each do
         Puppet.stubs(:[])
-        Puppet::Util::Settings.any_instance.stubs(:use)
+        Puppet.settings.stubs(:use)
         Puppet.stubs(:[]).with(:prerun_command).returns ""
         Puppet.stubs(:[]).with(:postrun_command).returns ""
         Puppet.stubs(:[]).with(:trace).returns(true)
diff --git a/spec/unit/application/master_spec.rb b/spec/unit/application/master_spec.rb
index 1cf06ff..1173752 100644
--- a/spec/unit/application/master_spec.rb
+++ b/spec/unit/application/master_spec.rb
@@ -119,7 +119,7 @@ describe Puppet::Application::Master do
       Puppet::Log.stubs(:level=)
       Puppet::SSL::CertificateAuthority.stubs(:instance)
       Puppet::SSL::CertificateAuthority.stubs(:ca?)
-      Puppet::Util::Settings.any_instance.stubs(:use)
+      Puppet.settings.stubs(:use)
 
       @master.options.stubs(:[]).with(any_parameters)
     end
@@ -183,14 +183,6 @@ describe Puppet::Application::Master do
       @master.setup
     end
 
-    it "mocha work-around" do
-      # Mocha 0.9.10 and earlier leaves behind a bogus "use" method
-      # See https://github.com/floehopper/mocha/issues#issue/20
-      class << Puppet.settings
-        remove_method :use rescue nil
-      end
-    end
-
     it "should cache class in yaml" do
       Puppet::Node.indirection.expects(:cache_class=).with(:yaml)
 
@@ -220,20 +212,11 @@ describe Puppet::Application::Master do
       end
 
       it "should tell Puppet.settings to use :ca category" do
-        Puppet.settings.stubs(:use)
         Puppet.settings.expects(:use).with(:ca)
 
         @master.setup
       end
 
-      it "mocha work-around" do
-        # Mocha 0.9.10 and earlier leaves behind a bogus "use" method
-        # See https://github.com/floehopper/mocha/issues#issue/20
-        class << Puppet.settings
-          remove_method :use rescue nil
-        end
-      end
-
       it "should instantiate the CertificateAuthority singleton" do
         Puppet::SSL::CertificateAuthority.expects(:instance)
 
diff --git a/spec/unit/configurer_spec.rb b/spec/unit/configurer_spec.rb
index 6b4998c..f8acdd0 100755
--- a/spec/unit/configurer_spec.rb
+++ b/spec/unit/configurer_spec.rb
@@ -8,7 +8,7 @@ require 'puppet/configurer'
 
 describe Puppet::Configurer do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @agent = Puppet::Configurer.new
   end
 
@@ -74,7 +74,7 @@ end
 
 describe Puppet::Configurer, "when executing a catalog run" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @agent = Puppet::Configurer.new
     @agent.stubs(:prepare)
     @agent.stubs(:facts_for_uploading).returns({})
@@ -82,6 +82,7 @@ describe Puppet::Configurer, "when executing a catalog run" do
     @catalog.stubs(:apply)
     @agent.stubs(:retrieve_catalog).returns @catalog
     @agent.stubs(:save_last_run_summary)
+    Puppet::Transaction::Report.indirection.stubs(:save)
   end
 
   it "should prepare for the run" do
@@ -226,7 +227,7 @@ end
 
 describe Puppet::Configurer, "when sending a report" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @configurer = Puppet::Configurer.new
     @configurer.stubs(:save_last_run_summary)
 
@@ -295,7 +296,7 @@ end
 
 describe Puppet::Configurer, "when saving the summary report file" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @configurer = Puppet::Configurer.new
 
     @report = stub 'report'
@@ -325,7 +326,7 @@ end
 
 describe Puppet::Configurer, "when retrieving a catalog" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @agent = Puppet::Configurer.new
     @agent.stubs(:facts_for_uploading).returns({})
 
@@ -455,7 +456,7 @@ end
 
 describe Puppet::Configurer, "when converting the catalog" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @agent = Puppet::Configurer.new
 
     @catalog = Puppet::Resource::Catalog.new
@@ -489,7 +490,7 @@ end
 
 describe Puppet::Configurer, "when preparing for a run" do
   before do
-    Puppet::Util::Settings.any_instance.stubs(:use).returns(true)
+    Puppet.settings.stubs(:use).returns(true)
     @agent = Puppet::Configurer.new
     @agent.stubs(:dostorage)
     @agent.stubs(:download_fact_plugins)

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list