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:
parent
ebf8961182
commit
fabcdc711b
1 changed files with 1 additions and 3 deletions
|
@ -523,13 +523,11 @@ class HashExtTest < ActiveSupport::TestCase
|
||||||
assert_equal 5, merged[:b]
|
assert_equal 5, merged[:b]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_reverse_merge
|
def test_indifferent_reverse_merging
|
||||||
hash = HashWithIndifferentAccess.new key: :old_value
|
hash = HashWithIndifferentAccess.new key: :old_value
|
||||||
hash.reverse_merge! key: :new_value
|
hash.reverse_merge! key: :new_value
|
||||||
assert_equal :old_value, hash[:key]
|
assert_equal :old_value, hash[:key]
|
||||||
end
|
|
||||||
|
|
||||||
def test_indifferent_reverse_merging
|
|
||||||
hash = HashWithIndifferentAccess.new('some' => 'value', 'other' => 'value')
|
hash = HashWithIndifferentAccess.new('some' => 'value', 'other' => 'value')
|
||||||
hash.reverse_merge!(:some => 'noclobber', :another => 'clobber')
|
hash.reverse_merge!(:some => 'noclobber', :another => 'clobber')
|
||||||
assert_equal 'value', hash[:some]
|
assert_equal 'value', hash[:some]
|
||||||
|
|
Loading…
Reference in a new issue