aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-06-26 12:09:40 +0200
committerJosé Valim <jose.valim@gmail.com>2010-06-26 12:09:56 +0200
commitaa48ab05f40788bd9f54124f91b0ad86869a7b06 (patch)
tree54bac8fabe9ec413d00ccc6cf1362363c55b64a5 /activesupport/test/ordered_hash_test.rb
parent9958950f78638e4a6c6800404d84f22effc0748e (diff)
downloadrails-aa48ab05f40788bd9f54124f91b0ad86869a7b06.tar.gz
rails-aa48ab05f40788bd9f54124f91b0ad86869a7b06.tar.bz2
rails-aa48ab05f40788bd9f54124f91b0ad86869a7b06.zip
Tidy up tests in previous commit since they did not assure an OrderedHash is returned (the test would pass for an array and would pass by chance for hashes).
[#4875 state:resolved]
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r--activesupport/test/ordered_hash_test.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb
index fc467b41de..89855814d7 100644
--- a/activesupport/test/ordered_hash_test.rb
+++ b/activesupport/test/ordered_hash_test.rb
@@ -259,8 +259,7 @@ class OrderedHashTest < Test::Unit::TestCase
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
+ assert_kind_of ActiveSupport::OrderedHash, @ordered_hash.invert
+ assert_equal @values.zip(@keys), @ordered_hash.invert.to_a
end
end