From 9984266c041e1079a09140f9307fc1ca13858988 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sat, 3 Sep 2011 14:43:33 +0700 Subject: Make `ActiveSupport::OrderedHash` extractable when using `Array#extract_options!` `ActiveSupport::OrderedHash` is actually a subclass of the hash, so it does make sense that it should be extractable from the array list. --- activesupport/test/ordered_hash_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/test/ordered_hash_test.rb') diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index bf851dbcbc..0b5f912dc4 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -329,4 +329,9 @@ class OrderedHashTest < Test::Unit::TestCase assert_equal expected, @ordered_hash.invert assert_equal @values.zip(@keys), @ordered_hash.invert.to_a end + + def test_extractable + @ordered_hash[:rails] = "snowman" + assert_equal @ordered_hash, [1, 2, @ordered_hash].extract_options! + end end -- cgit v1.2.3