diff options
| author | Luke Kanies <luke@madstop.com> | 2009-07-15 14:44:31 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-07-16 21:23:03 +1000 |
| commit | ba824e94fd0c7652b9b7bb7878f76a935dc7927d (patch) | |
| tree | b4ae93af2413171ce045cf335e32af9741f06d0b /spec | |
| parent | eb40966777beaff2ceca8b91e10e3cb0132ec218 (diff) | |
| download | puppet-ba824e94fd0c7652b9b7bb7878f76a935dc7927d.tar.gz puppet-ba824e94fd0c7652b9b7bb7878f76a935dc7927d.tar.xz puppet-ba824e94fd0c7652b9b7bb7878f76a935dc7927d.zip | |
Fixing #2245 - provider lists are not lost on type reload
We've moved the @providers class instance variable from
the individual Puppet::Type subclasses into a single
class instance variable in the Puppet::Type base class,
and are using an accessor to retrieve the per-class
providers hash.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/integration/type.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/integration/type.rb b/spec/integration/type.rb new file mode 100755 index 000000000..78e8947ec --- /dev/null +++ b/spec/integration/type.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../spec_helper' + +require 'puppet/type' + +describe Puppet::Type do + it "should not lose its provider list when it is reloaded" do + type = Puppet::Type.newtype(:integration_test) do + newparam(:name) {} + end + + provider = type.provide(:myprovider) {} + + # reload it + type = Puppet::Type.newtype(:integration_test) do + newparam(:name) {} + end + + type.provider(:myprovider).should equal(provider) + end +end |
