diff options
| author | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-21 16:55:50 -0700 |
|---|---|---|
| committer | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-21 16:55:50 -0700 |
| commit | 45613e0f192778cd16f945d5d1eb109e6c8dee2d (patch) | |
| tree | 3d477eabf1c81d33f10369158db998a29963de12 | |
| parent | 0f4a4300f18da04fc672475645c0d2ba9721d1d5 (diff) | |
| parent | c2627a3229577685a5baef1796f7f5b525fed667 (diff) | |
| download | puppet-45613e0f192778cd16f945d5d1eb109e6c8dee2d.tar.gz puppet-45613e0f192778cd16f945d5d1eb109e6c8dee2d.tar.xz puppet-45613e0f192778cd16f945d5d1eb109e6c8dee2d.zip | |
Merge branch 'tickets/master/maint'
| -rw-r--r-- | lib/puppet/interface.rb | 4 | ||||
| -rw-r--r-- | spec/unit/interface/indirector_spec.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/interface_spec.rb | 20 |
3 files changed, 0 insertions, 28 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb index 13b1a811b..38841d948 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 c0b738c96..c4d93ade3 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 cfa0111f6..73f7a4569 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) |
