diff options
author | James A. Rosen <james@zendesk.com> | 2010-10-20 08:01:02 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-11-07 17:27:07 -0200 |
commit | 697f4851b8bc4eb539b3e565e8b6349cafed8aaa (patch) | |
tree | eb3b9690c8d3e47de088f47a90974f5a7e85af33 /activesupport/test | |
parent | 990f52ebd78df77d73a2187751c6e1bb6d4b6033 (diff) | |
download | rails-697f4851b8bc4eb539b3e565e8b6349cafed8aaa.tar.gz rails-697f4851b8bc4eb539b3e565e8b6349cafed8aaa.tar.bz2 rails-697f4851b8bc4eb539b3e565e8b6349cafed8aaa.zip |
OrderedHash#select now preserves order [#5843 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 50778b5864..72088854fc 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -109,6 +109,14 @@ class OrderedHashTest < Test::Unit::TestCase assert_equal @keys, keys end + def test_find_all + assert_equal @keys, @ordered_hash.find_all { true }.map(&:first) + end + + def test_select + assert_equal @keys, @ordered_hash.select { true }.map(&:first) + end + def test_delete_if copy = @ordered_hash.dup copy.delete('pink') |