File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -540,6 +540,9 @@ def initialize(args = {})
540
540
@base = args [ :base ] || DefaultTreebase
541
541
@force_no_page = args [ :force_no_page ] || DefaultForceNoPage
542
542
@encryption = args [ :encryption ] # may be nil
543
+ if !@encryption . nil? and !@encryption . is_a? ( Hash )
544
+ raise ArgumentError , "encryption must be given as Hash"
545
+ end
543
546
@connect_timeout = args [ :connect_timeout ]
544
547
545
548
if pr = @auth [ :password ] and pr . respond_to? ( :call )
Original file line number Diff line number Diff line change @@ -91,4 +91,10 @@ def test_encryption
91
91
92
92
assert_equal enc [ :method ] , :start_tls
93
93
end
94
+
95
+ def test_initialize
96
+ assert_raise ArgumentError , "encryption must be given as Hash" do
97
+ Net ::LDAP . new encryption : [ :simple_tls ]
98
+ end
99
+ end
94
100
end
You can’t perform that action at this time.
0 commit comments