summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-05-26 14:54:11 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-26 14:57:36 -0700
commit654783564afd082c2e3e436cdf1bc3dc60308497 (patch)
treeb7b5447b5bd4f9f4821e00cdf8d9f20d7a561802 /spec/unit
parent0bcbca53f3248137de517a4942e4db70ab06e296 (diff)
downloadpuppet-654783564afd082c2e3e436cdf1bc3dc60308497.tar.gz
puppet-654783564afd082c2e3e436cdf1bc3dc60308497.tar.xz
puppet-654783564afd082c2e3e436cdf1bc3dc60308497.zip
(#7690) Don't blow up when listing terminuses available for faces
Previously, in order to list the available terminuses for an indirected face we loaded all the the terminuses in order to list them. This meant that if a terminus like active_record didn't have the dependencies it needed, the documentation would raise errors and not list terminuses. <Puppet::Error: Could not autoload filename uninitialized constant Object::ActiveRecord> Now we just list the terminuses available in the load path without trying to load them. The terminus will still raise an error if you try to use it without its dependencies being met. Paired-with: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/indirector/terminus_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/indirector/terminus_spec.rb b/spec/unit/indirector/terminus_spec.rb
index 33932cfca..2f37c1ff5 100755
--- a/spec/unit/indirector/terminus_spec.rb
+++ b/spec/unit/indirector/terminus_spec.rb
@@ -242,3 +242,9 @@ describe Puppet::Indirector::Terminus, " when creating terminus class types", :'
end
end
+describe Puppet::Indirector::Terminus, " when listing terminus classes" do
+ it "should list the terminus files available to load" do
+ Puppet::Util::Autoload.any_instance.stubs(:files_to_load).returns ["/foo/bar/baz", "/max/runs/marathon"]
+ Puppet::Indirector::Terminus.terminus_classes('my_stuff').should == [:baz, :marathon]
+ end
+end