mirror of https://github.com/rails/rails
test/hash: move lonely indifferent hash test
This commit is contained in:
parent
fa30dd6d2e
commit
9578d574f3
|
@ -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')
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue