aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r--activesupport/test/ordered_hash_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb
index f3d2ec0286..fc467b41de 100644
--- a/activesupport/test/ordered_hash_test.rb
+++ b/activesupport/test/ordered_hash_test.rb
@@ -257,4 +257,10 @@ class OrderedHashTest < Test::Unit::TestCase
@updated_ordered_hash.update(:name => "Bob")
assert_equal [:name], @updated_ordered_hash.keys
end
+
+ def test_invert
+ @ordered_hash = ActiveSupport::OrderedHash[[["foo", "FOO"], ["bar", "BAR"]]]
+ @inverted_ordered_hash = @ordered_hash.invert
+ assert_equal [["FOO", "foo"], ["BAR", "bar"]], @inverted_ordered_hash.to_a
+ end
end