summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/indirector/ldap/node.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/unit/indirector/ldap/node.rb b/spec/unit/indirector/ldap/node.rb
index 739a2a5b0..6667efdd5 100755
--- a/spec/unit/indirector/ldap/node.rb
+++ b/spec/unit/indirector/ldap/node.rb
@@ -82,7 +82,7 @@ describe Puppet::Indirector::Ldap::Node, " when searching for nodes" do
end
end
-describe Puppet::Indirector::Ldap::Node, " when a parent node exists" do
+describe Puppet::Indirector::Ldap::Node, " when a parent node is specified" do
include LdapNodeSearching
before do
@@ -99,6 +99,15 @@ describe Puppet::Indirector::Ldap::Node, " when a parent node exists" do
@searcher.stubs(:parent_attribute).returns(:parent)
end
+ it "should fail if the parent cannot be found" do
+ @connection.stubs(:search).with { |*args| args[2] == 'parent' }.returns("whatever")
+
+ @entry.stubs(:to_hash).returns({})
+ @entry.stubs(:vals).with(:parent).returns(%w{parent})
+
+ proc { @searcher.find("mynode") }.should raise_error(Puppet::Error)
+ end
+
it "should add any parent classes to the node's classes" do
@entry.stubs(:to_hash).returns({})
@entry.stubs(:vals).with(:parent).returns(%w{parent})