summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-02-13 10:28:50 +0000
committerSteve Kemp <steve@steve.org.uk>2013-02-13 10:28:50 +0000
commit72fdb56b946b564b736be4e5f7702d1b96c8a8ed (patch)
tree00ab7a8b45aadbb71a5744feb5a75a9a549d722b /t
parentca2ac022cae1a034b0a941bfbae116ed37a75385 (diff)
Added test code.
Diffstat (limited to 't')
-rwxr-xr-xt/test-ldap-probe.t63
1 files changed, 63 insertions, 0 deletions
diff --git a/t/test-ldap-probe.t b/t/test-ldap-probe.t
new file mode 100755
index 0000000..8a2b221
--- /dev/null
+++ b/t/test-ldap-probe.t
@@ -0,0 +1,63 @@
+#!/usr/bin/ruby -Ilib/ -I../lib/
+
+
+require 'test/unit'
+
+require 'custodian/protocoltests'
+
+
+
+class TestLDAPProbe < Test::Unit::TestCase
+
+ #
+ # Create the test suite environment: NOP.
+ #
+ def setup
+ end
+
+ #
+ # Destroy the test suite environment: NOP.
+ #
+ def teardown
+ end
+
+
+ #
+ # Test the sanity of a good test.
+ #
+ def test_expected_usage
+ test = nil
+
+ assert_nothing_raised do
+ test = Custodian::TestFactory.create( "auth.bytemark.co.uk must run ldap on 389 with username 'testing' with password 'bob' otherwise 'LDAP dead?'." )
+ end
+
+ assert( test )
+ assert_equal( test.get_type, "ldap" )
+ end
+
+
+
+ #
+ # Ensure missing a test raises an error.
+ #
+ def test_missing_ldap()
+ #
+ # test data
+ #
+ data = {
+ "foo.example.com must run ldap on 389.",
+ "foo.example.com must run ldap with username 'test'."
+ }
+
+ #
+ # For each test
+ #
+ data.each do |str|
+ assert_raise ArgumentError do
+ test = Custodian::TestFactory.create( str )
+ end
+ end
+ end
+
+end