Skip to content

Commit f5ac5fc

Browse files
committed
Fix
1 parent 42add5f commit f5ac5fc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/net/ldap/entry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,6 @@ def setter?(sym)
198198
private :setter?
199199

200200
def ==(other)
201-
return self['dn'] == other['dn']
201+
return @myhash == other.to_h
202202
end
203203
end # class Entry

test/test_entry.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ def test_equal_operator
5959
@entry_two = Net::LDAP::Entry.new 'cn=Barbara,o=corp'
6060
assert_equal @entry, @entry_two
6161

62-
@entry_three = Net::LDAP::Entry.new 'cn=Bob,o=corp'
63-
assert_not_equal @entry, @entry_three
62+
@entry['sn'] = 'Jensen'
63+
assert_not_equal @entry, @entry_two
64+
65+
@entry_two['sn'] = 'Jensen'
66+
assert_equal @entry, @entry_two
6467
end
6568
end
6669

0 commit comments

Comments
 (0)