From 5ff8506229d679afac3a74c3323f38890d36ce62 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 24 Jun 2013 07:06:56 +0100 Subject: Allow the code to load when the ruby LDAP module is not present. Although the actual protocol-test will instafail this allows the test suite to be executed without the LDAP library being present. --- lib/custodian/protocoltest/ldap.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/custodian/protocoltest') diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb index dfe1cc8..53257a0 100644 --- a/lib/custodian/protocoltest/ldap.rb +++ b/lib/custodian/protocoltest/ldap.rb @@ -1,5 +1,4 @@ -require 'ldap' # # The LDAP-protocol test. @@ -75,7 +74,6 @@ module Custodian - # # Allow this test to be serialized. # @@ -91,6 +89,13 @@ module Custodian # def run_test + begin + require 'ldap' + rescue LoadError + @error = "LDAP library not available - test disabled" + return false + end + # reset the error, in case we were previously executed. @error = nil @@ -145,8 +150,6 @@ module Custodian register_test_type "ldap" - - + end end end -end -- cgit v1.2.1