[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Pieter van de Bruggen
pieter at puppetlabs.com
Tue May 10 08:06:35 UTC 2011
The following commit has been merged in the experimental branch:
commit c2627a3229577685a5baef1796f7f5b525fed667
Author: Pieter van de Bruggen <pieter at puppetlabs.com>
Date: Mon Mar 21 16:53:49 2011 -0700
(Maint.) Remove Puppet::Interface#unload_interface
Reviewed-By: Nick Lewis
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index 13b1a81..38841d9 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -53,10 +53,6 @@ class Puppet::Interface
const_set(constantize(name), instance)
end
- def self.unload_interface(name)
- remove_const(constantize(name)) rescue nil
- end
-
def self.constantize(name)
unless name.to_s =~ /^[-_a-z]+$/i then
raise ArgumentError, "#{name.inspect} (#{name.class}) is not a valid interface name"
diff --git a/spec/unit/interface/indirector_spec.rb b/spec/unit/interface/indirector_spec.rb
index c0b738c..c4d93ad 100644
--- a/spec/unit/interface/indirector_spec.rb
+++ b/spec/unit/interface/indirector_spec.rb
@@ -12,10 +12,6 @@ describe Puppet::Interface::Indirector do
@instance.stubs(:indirection).returns @indirection
end
- after do
- Puppet::Interface.unload_interface(:test)
- end
-
it "should be a subclass of Interface" do
Puppet::Interface::Indirector.superclass.should equal(Puppet::Interface)
end
diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
index cfa0111..73f7a45 100755
--- a/spec/unit/interface_spec.rb
+++ b/spec/unit/interface_spec.rb
@@ -4,10 +4,6 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
require 'puppet/interface'
describe Puppet::Interface do
- after do
- Puppet::Interface.unload_interface(:me)
- end
-
describe "at initialization" do
it "should require a name" do
Puppet::Interface.new(:me).name.should == :me
@@ -60,26 +56,10 @@ describe Puppet::Interface do
it "should create an associated constant when registering an interface" do
$stderr.stubs(:puts)
face = Puppet::Interface.new(:me)
- Puppet::Interface.unload_interface(:me) # to remove from the initial registration
Puppet::Interface.register_interface(:me, face)
Puppet::Interface::Me.should equal(face)
end
- # Why is unloading interfaces important?
- it "should be able to unload interfaces" do
- $stderr.stubs(:puts)
- face = Puppet::Interface.new(:me)
- Puppet::Interface.unload_interface(:me)
- Puppet::Interface.const_defined?(:Me).should be_false
- end
-
- it "should remove the associated constant when an interface is unregistered" do
- $stderr.stubs(:puts)
- face = Puppet::Interface.new(:me)
- Puppet::Interface.unload_interface(:me)
- Puppet::Interface.const_defined?("Me").should be_false
- end
-
it "should try to require interfaces that are not known" do
Puppet::Interface.expects(:require).with "puppet/interface/foo"
Puppet::Interface.const_get(:Foo)
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list