minor: added array#uniq test for OrderedHash

This commit is contained in:
Kyle Banker 2009-12-14 12:56:29 -05:00
parent 1cbb5d01ef
commit 570305c46b
1 changed files with 16 additions and 0 deletions

View File

@ -23,6 +23,22 @@ class OrderedHashTest < Test::Unit::TestCase
assert_equal [], OrderedHash.new.keys assert_equal [], OrderedHash.new.keys
end end
def test_uniq
list = []
doc = OrderedHash.new
doc['_id'] = 'ab12'
doc['name'] = 'test'
same_doc = OrderedHash.new
same_doc['_id'] = 'ab12'
same_doc['name'] = 'test'
list << doc
list << same_doc
assert_equal 2, list.size
assert_equal 1, list.uniq.size
end
def test_equality def test_equality
a = OrderedHash.new a = OrderedHash.new
a['x'] = 1 a['x'] = 1