File: tc_schema.rb

package info (click to toggle)
ruby-ldap 0.9.20-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 452 kB
  • sloc: ansic: 4,097; ruby: 1,525; makefile: 5
file content (32 lines) | stat: -rwxr-xr-x 949 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# $Id: tc_schema.rb,v 1.4 2005/03/13 10:11:41 ianmacd Exp $
#
# A suite of unit tests for testing Ruby/LDAP schema functionality.

require 'ldap'
require 'ldap/schema'
require 'test/unit'
require './setup'

class TC_SchemaTest < TC_LDAPTest

  def test_schema
    schema = @@conn.schema
    assert_instance_of( LDAP::Schema, schema )
    assert( schema.key?( 'attributeTypes' ) )
    assert( schema.key?( 'ldapSyntaxes' ) )
    assert( schema.key?( 'matchingRules' ) )
    assert( schema.key?( 'matchingRuleUse' ) )
    assert( schema.key?( 'objectClasses' ) )
  end

  def test_root_dse
    root_dse = @@conn.root_dse[0]
    assert( root_dse.key?( 'subschemaSubentry' ) )
    assert( root_dse.key?( 'namingContexts' ) )
    assert( root_dse.key?( 'supportedSASLMechanisms' ) )
    assert( root_dse.key?( 'supportedControl' ) )
    assert( root_dse.key?( 'supportedExtension' ) )
    assert( root_dse.key?( 'supportedLDAPVersion' ) )
  end
    
end