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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Importing, but disabling, tests from other repos.
- Loading branch information
Austin Ziegler
committed
Mar 27, 2010
1 parent
090bad9
commit 28d58cd
Showing
3 changed files
with
106 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,59 @@ | ||
require 'common' | ||
|
||
=begin | ||
class TestEntry < Test::Unit::TestCase | ||
def test_entry | ||
# FIX | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters