aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_test.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-09-03 14:43:33 +0700
committerPrem Sichanugrist <s@sikachu.com>2011-09-03 14:43:33 +0700
commit9984266c041e1079a09140f9307fc1ca13858988 (patch)
tree077b80e77f01524b84dd5dcacda86c26d031b197 /activesupport/test/ordered_hash_test.rb
parent36f1612c34577225d1f71c368e70c234d5197707 (diff)
downloadrails-9984266c041e1079a09140f9307fc1ca13858988.tar.gz
rails-9984266c041e1079a09140f9307fc1ca13858988.tar.bz2
rails-9984266c041e1079a09140f9307fc1ca13858988.zip
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.
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r--activesupport/test/ordered_hash_test.rb5
1 files changed, 5 insertions, 0 deletions
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