summaryrefslogtreecommitdiffstats
path: root/spec/unit/node/configuration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/node/configuration.rb')
-rwxr-xr-xspec/unit/node/configuration.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb
index 6b0677973..c94f31380 100755
--- a/spec/unit/node/configuration.rb
+++ b/spec/unit/node/configuration.rb
@@ -490,3 +490,27 @@ describe Puppet::Node::Configuration, " when writing dot files" do
Puppet.settings.clear
end
end
+
+describe Puppet::Node::Configuration, " when indirecting" do
+ before do
+ @indirection = mock 'indirection'
+
+ Puppet::Indirector::Indirection.clear_cache
+ @configuration = Puppet::Node::Facts.new("me")
+ end
+
+ it "should redirect to the indirection for retrieval" do
+ Puppet::Node::Configuration.stubs(:indirection).returns(@indirection)
+ @indirection.expects(:find).with(:myconfig)
+ Puppet::Node::Configuration.find(:myconfig)
+ end
+
+ it "should default to the code terminus" do
+ Puppet::Node::Configuration.indirection.terminus_class.should == :code
+ end
+
+ after do
+ mocha_verify
+ Puppet::Indirector::Indirection.clear_cache
+ end
+end