[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:07:23 UTC 2011


The following commit has been merged in the experimental branch:
commit af79d3c63479a77278e174f370b4b3d156bec1a1
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Tue Mar 22 18:05:51 2011 -0700

    maint: Fix order-dependent spec failures
    
    The specs for InterfaceCollection were clearing the list of interfaces at the
    end of the spec run, which caused later specs to fail because they couldn't
    re-require interfaces they needed. This fixes the InterfaceCollection specs to
    save and restore the interfaces at the end of the file.
    
    Reviewed-By: Matt Robinson

diff --git a/spec/unit/application/interface_base_spec.rb b/spec/unit/application/interface_base_spec.rb
index 3e7c04f..0df0308 100644
--- a/spec/unit/application/interface_base_spec.rb
+++ b/spec/unit/application/interface_base_spec.rb
@@ -2,13 +2,12 @@
 
 require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
 require 'puppet/application/interface_base'
-require 'puppet/application/interface_base'
-
-base_interface = Puppet::Interface.interface(:basetest)
-class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase
-end
 
 describe Puppet::Application::InterfaceBase do
+  base_interface = Puppet::Interface.interface(:basetest)
+  class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase
+  end
+
   before do
     @app = Puppet::Application::InterfaceBase::Basetest.new
     @app.stubs(:interface).returns base_interface
diff --git a/spec/unit/interface/interface_collection_spec.rb b/spec/unit/interface/interface_collection_spec.rb
index 536e694..42a0f24 100644
--- a/spec/unit/interface/interface_collection_spec.rb
+++ b/spec/unit/interface/interface_collection_spec.rb
@@ -3,12 +3,18 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
 require 'puppet/interface/interface_collection'
 
 describe Puppet::Interface::InterfaceCollection do
+  # This is global state that other tests depend on, so we have to save and
+  # restore it
+  before :all do
+    @saved_interfaces = subject.instance_variable_get("@interfaces").dup
+  end
+
   before :each do
     subject.instance_variable_set("@interfaces", {})
   end
 
   after :all do
-    subject.instance_variable_set("@interfaces", {})
+    subject.instance_variable_set("@interfaces", @saved_interfaces)
   end
 
   describe "::interfaces" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list