This repository was archived by the owner on Oct 5, 2023. It is now read-only.
forked from RoryO/ruby-net-ldap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_entry.rb
59 lines (49 loc) · 1.63 KB
/
test_entry.rb
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'common'
=begin
class TestEntry < Test::Unit::TestCase
Commented out until I can make it a spec.
context "An instance of Entry" do
setup do
@entry = Net::LDAP::Entry.new 'cn=Barbara,o=corp'
end
should "be initialized with the DN" do
assert_equal 'cn=Barbara,o=corp', @entry.dn
end
should 'return an empty array when accessing a nonexistent attribute (index lookup)' do
assert_equal [], @entry['sn']
end
should 'return an empty array when accessing a nonexistent attribute (method call)' do
assert_equal [], @entry.sn
end
should 'create an attribute on assignment (index lookup)' do
@entry['sn'] = 'Jensen'
assert_equal ['Jensen'], @entry['sn']
end
should 'create an attribute on assignment (method call)' do
@entry.sn = 'Jensen'
assert_equal ['Jensen'], @entry.sn
end
should 'have attributes accessible by index lookup' do
@entry['sn'] = 'Jensen'
assert_equal ['Jensen'], @entry['sn']
end
should 'have attributes accessible using a Symbol as the index' do
@entry[:sn] = 'Jensen'
assert_equal ['Jensen'], @entry[:sn]
end
should 'have attributes accessible by method call' do
@entry['sn'] = 'Jensen'
assert_equal ['Jensen'], @entry.sn
end
should 'ignore case of attribute names' do
@entry['sn'] = 'Jensen'
assert_equal ['Jensen'], @entry.sn
assert_equal ['Jensen'], @entry.Sn
assert_equal ['Jensen'], @entry.SN
assert_equal ['Jensen'], @entry['sn']
assert_equal ['Jensen'], @entry['Sn']
assert_equal ['Jensen'], @entry['SN']
end
end
end
=end