test/hash: move lonely indifferent hash test

This commit is contained in:
Simon Eskildsen 2015-07-10 15:29:23 +00:00
parent fa30dd6d2e
commit 9578d574f3
2 changed files with 6 additions and 11 deletions

View File

@ -523,6 +523,12 @@ class HashExtTest < ActiveSupport::TestCase
assert_equal 5, merged[:b]
end
def test_reverse_merge
hash = HashWithIndifferentAccess.new key: :old_value
hash.reverse_merge! key: :new_value
assert_equal :old_value, hash[:key]
end
def test_indifferent_reverse_merging
hash = HashWithIndifferentAccess.new('some' => 'value', 'other' => 'value')
hash.reverse_merge!(:some => 'noclobber', :another => 'clobber')

View File

@ -1,11 +0,0 @@
require 'abstract_unit'
require 'active_support/hash_with_indifferent_access'
class HashWithIndifferentAccessTest < ActiveSupport::TestCase
def test_reverse_merge
hash = HashWithIndifferentAccess.new key: :old_value
hash.reverse_merge! key: :new_value
assert_equal :old_value, hash[:key]
end
end