Skip to content

Commit 2415276

Browse files
author
Jerry Cheung
committed
add additional ldif parsing entry tests
1 parent 8d65ad6 commit 2415276

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/test_entry.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,26 @@ def test_case_insensitive_attribute_names
4040
assert_equal ['Jensen'], @entry['SN']
4141
end
4242
end
43+
44+
class TestEntryLDIF < Test::Unit::TestCase
45+
def setup
46+
@entry = Net::LDAP::Entry.from_single_ldif_string(
47+
%Q{dn: something
48+
foo: foo
49+
barAttribute: bar
50+
})
51+
end
52+
53+
def test_attribute
54+
assert_equal ['foo'], @entry.foo
55+
assert_equal ['foo'], @entry.Foo
56+
end
57+
58+
def test_modify_attribute
59+
@entry.foo = 'bar'
60+
assert_equal ['bar'], @entry.foo
61+
62+
@entry.fOo= 'baz'
63+
assert_equal ['baz'], @entry.foo
64+
end
65+
end

0 commit comments

Comments
 (0)