diff options
author | Simon Eskildsen <sirup@sirupsen.com> | 2015-07-10 15:29:23 +0000 |
---|---|---|
committer | Simon Eskildsen <sirup@sirupsen.com> | 2015-07-10 15:54:37 +0000 |
commit | 9578d574f3be8da966ee7355dfb1604936a103cb (patch) | |
tree | 28c35238c3557a60269e9dbbca9638981268c603 /activesupport | |
parent | fa30dd6d2e3151ac2be16673d40cb458a76f1dbe (diff) | |
download | rails-9578d574f3be8da966ee7355dfb1604936a103cb.tar.gz rails-9578d574f3be8da966ee7355dfb1604936a103cb.tar.bz2 rails-9578d574f3be8da966ee7355dfb1604936a103cb.zip |
test/hash: move lonely indifferent hash test
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 6 | ||||
-rw-r--r-- | activesupport/test/hash_with_indifferent_access_test.rb | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 6f66d70217..cae7b85f11 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -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') diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb deleted file mode 100644 index 1facd691fa..0000000000 --- a/activesupport/test/hash_with_indifferent_access_test.rb +++ /dev/null @@ -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 |