Permalink
Browse files

Tidy up tests in previous commit since they did not assure an Ordered…

…Hash is returned (the test would pass for an array and would pass by chance for hashes).

[#4875 state:resolved]
  • Loading branch information...
1 parent 449cf50 commit 0e9190c902d075c70e2f54096ae55476ed47b6a3 @josevalim josevalim committed Jun 26, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/test/ordered_hash_test.rb
@@ -230,8 +230,8 @@ def test_update_sets_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
+ expected = ActiveSupport::OrderedHash[@values.zip(@keys)]
+ assert_equal expected, @ordered_hash.invert
+ assert_equal @values.zip(@keys), @ordered_hash.invert.to_a
end
end

0 comments on commit 0e9190c

Please sign in to comment.