From 697f4851b8bc4eb539b3e565e8b6349cafed8aaa Mon Sep 17 00:00:00 2001 From: "James A. Rosen" Date: Wed, 20 Oct 2010 08:01:02 -0700 Subject: OrderedHash#select now preserves order [#5843 state:resolved] Signed-off-by: Santiago Pastorino --- activesupport/test/ordered_hash_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/test') 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') -- cgit v1.2.3