summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-06-10 10:58:19 -0700
committerNick Lewis <nick@puppetlabs.com>2011-06-10 11:54:26 -0700
commitcaca469976cc8b5ff6c7f68d7324eecd35399176 (patch)
tree7d1cd7e393d79e0a4840f781e671c5c28c99f1d1 /spec
parent413b136671232a8a0a9e27c18c1b6547241276e7 (diff)
downloadpuppet-caca469976cc8b5ff6c7f68d7324eecd35399176.tar.gz
puppet-caca469976cc8b5ff6c7f68d7324eecd35399176.tar.xz
puppet-caca469976cc8b5ff6c7f68d7324eecd35399176.zip
(#4416) Ensure types are providified after reloading
Previously, the 'provider' parameter for a type was only added when creating a provider for that type. This would cause a type to forget about its 'provider' parameter when only the type was reloaded. This was manifesting itself in pluginsync, when a provider plugin would be loaded before its type, causing the type to be autoloaded. The type plugin would then be loaded again by the plugin handler. Because the type => provider information is stored separately from the type, the providers don't need to be reloaded, and thus don't recreate the type's 'provider' parameter. Now we always "providify" the type (add its 'provider' parameter) upon creation, after trying to load its providers, if any providers are present. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/type_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/integration/type_spec.rb b/spec/integration/type_spec.rb
index 957dfe344..74e268a3c 100755
--- a/spec/integration/type_spec.rb
+++ b/spec/integration/type_spec.rb
@@ -19,4 +19,15 @@ describe Puppet::Type do
type.provider(:myprovider).should equal(provider)
end
+
+ it "should not lose its provider parameter when it is reloaded" do
+ type = Puppet::Type.newtype(:reload_test_type)
+
+ provider = type.provide(:test_provider)
+
+ # reload it
+ type = Puppet::Type.newtype(:reload_test_type)
+
+ type.parameters.should include(:provider)
+ end
end