summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-07 17:52:26 -0700
committerJames Turnbull <james@lovedthanlost.net>2008-08-09 07:24:25 +1000
commit3ae7eca3928d5dd9d0c93e61ceedc38f60573eb5 (patch)
tree34d17064f13d1124086dde62fa5a6b39b41562c5
parentd3393b462f076ec868ac59baa56ae0e93e9a9f06 (diff)
downloadpuppet-3ae7eca3928d5dd9d0c93e61ceedc38f60573eb5.tar.gz
puppet-3ae7eca3928d5dd9d0c93e61ceedc38f60573eb5.tar.xz
puppet-3ae7eca3928d5dd9d0c93e61ceedc38f60573eb5.zip
Fixing an ldap connectivity test
Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-xspec/unit/indirector/ldap.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/unit/indirector/ldap.rb b/spec/unit/indirector/ldap.rb
index 52abd413a..2c4060c4d 100755
--- a/spec/unit/indirector/ldap.rb
+++ b/spec/unit/indirector/ldap.rb
@@ -113,15 +113,25 @@ describe Puppet::Indirector::Ldap do
describe "when connecting to ldap" do
confine "LDAP is not available" => Puppet.features.ldap?
+ it "should create and start a Util::Ldap::Connection instance" do
+ conn = mock 'connection', :connection => "myconn", :start => nil
+ Puppet::Util::Ldap::Connection.expects(:instance).returns conn
+
+ @searcher.connection.should == "myconn"
+ end
+
it "should only create the ldap connection when asked for it the first time" do
- @searcher.connection.should equal(@searcher.connection)
+ conn = mock 'connection', :connection => "myconn", :start => nil
+ Puppet::Util::Ldap::Connection.expects(:instance).returns conn
+
+ @searcher.connection
end
- it "should create and start a Util::Ldap::Connection instance" do
+ it "should cache the connection" do
conn = mock 'connection', :connection => "myconn", :start => nil
Puppet::Util::Ldap::Connection.expects(:instance).returns conn
- @searcher.connection.should == "myconn"
+ @searcher.connection.should equal(@searcher.connection)
end
end