File: test_entry_attribute.rb

package info (click to toggle)
ruby-activeldap 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,588 kB
  • sloc: ruby: 18,143; sh: 12; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-

require "al-test-utils"

class TestEntryAttribute < Test::Unit::TestCase
  include AlTestUtils

  class TestExist < self
    priority :must
    def test_existence
      schema = ActiveLdap::Base.connection.schema
      object_classes = ["posixAccount"]
      entry_attribute = ActiveLdap::EntryAttribute.new(schema, object_classes)
      assert_true(entry_attribute.exist?("cn"))
    end

    def test_non_existence
      schema = nil
      object_classes = []
      entry_attribute = ActiveLdap::EntryAttribute.new(schema, object_classes)
      assert_false(entry_attribute.exist?("nonExistence"))
    end
  end
end