diff options
author | Ken Collins <ken@metaskills.net> | 2009-05-09 18:35:31 -0400 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-05-10 13:04:46 +1200 |
commit | 9e0cfdb7f951c0446cdfd3b2cc26443712fe657a (patch) | |
tree | 9bc96bd5c72b891b491f49a908108fa94b838fed /activesupport/test | |
parent | 235775de291787bba6b7bc3c58e791216c3b5090 (diff) | |
download | rails-9e0cfdb7f951c0446cdfd3b2cc26443712fe657a.tar.gz rails-9e0cfdb7f951c0446cdfd3b2cc26443712fe657a.tar.bz2 rails-9e0cfdb7f951c0446cdfd3b2cc26443712fe657a.zip |
ActiveSupport::OrderedHash#to_a method returns an ordered set of arrays. Matches ruby1.9's Hash#to_a.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2629 state:committed]
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 7cd8c8a8f4..6fccbbdc41 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -51,6 +51,10 @@ class OrderedHashTest < Test::Unit::TestCase assert_same @ordered_hash, @ordered_hash.to_hash end + def test_to_a + assert_equal @keys.zip(@values), @ordered_hash.to_a + end + def test_has_key assert_equal true, @ordered_hash.has_key?('blue') assert_equal true, @ordered_hash.key?('blue') |