We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dd6c3a commit 42bdeb9Copy full SHA for 42bdeb9
spec/unit/ldap/search_spec.rb
@@ -0,0 +1,30 @@
1
+# -*- ruby encoding: utf-8 -*-
2
+
3
+describe Net::LDAP, "search method" do
4
+ class FakeConnection
5
+ def search(args)
6
+ error_code = 1
7
+ return error_code
8
+ end
9
10
11
+ before(:each) do
12
+ @connection = Net::LDAP.new
13
+ @connection.instance_variable_set(:@open_connection, FakeConnection.new)
14
15
16
+ context "when returning result set" do
17
+ it "should return nil upon error" do
18
+ result_set = @connection.search(:return_result => true) do
19
20
+ result_set.should be_nil
21
22
23
24
+ context "when returning boolean" do
25
+ it "should return false upon error" do
26
+ success = @connection.search(:return_result => false)
27
+ success.should == false
28
29
30
+end
0 commit comments