1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reuse the same test for HWIA reverse_merge!

This commit is contained in:
Rafael Mendonça França 2015-07-10 13:45:37 -03:00
parent ebf8961182
commit fabcdc711b

View file

@ -523,13 +523,11 @@ class HashExtTest < ActiveSupport::TestCase
assert_equal 5, merged[:b]
end
def test_reverse_merge
def test_indifferent_reverse_merging
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')
assert_equal 'value', hash[:some]