diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-09 20:36:24 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-10 09:07:47 -0800 |
commit | 355f41d8aafd75d76db25cdda4736e0052b0605c (patch) | |
tree | 0dca4b27bcb61c24d38f28f34f7c6cbdc5ac4596 /activesupport/test | |
parent | 014b7994ac1a829845e2882f4c852bc28bd2aa53 (diff) | |
download | rails-355f41d8aafd75d76db25cdda4736e0052b0605c.tar.gz rails-355f41d8aafd75d76db25cdda4736e0052b0605c.tar.bz2 rails-355f41d8aafd75d76db25cdda4736e0052b0605c.zip |
Rework ActiveSupport::OrderedHash to make lookups faster
[#1352 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 17dffbd624..094f9316d6 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -73,4 +73,14 @@ class OrderedHashTest < Test::Unit::TestCase @ordered_hash.each_value { |v| values << v } assert_equal @values, values end + + def test_each + values = [] + @ordered_hash.each {|key, value| values << value} + assert_equal @values, values + end + + def test_each_with_index + @ordered_hash.each_with_index { |pair, index| assert_equal [@keys[index], @values[index]], pair} + end end |