diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-07-06 07:25:04 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-07-06 07:25:04 -0700 |
commit | 09965710dc7058abd2da3af1a27d7b72de009be6 (patch) | |
tree | d56af1342f4e79dde5a1f2328ad2b429d6465e62 /activesupport/test | |
parent | 01d4941d0c87764742562c59d4bf7bb34ac108c4 (diff) | |
parent | 20c065594f1434c93e6fe64cad062a0df1f42a8e (diff) | |
download | rails-09965710dc7058abd2da3af1a27d7b72de009be6.tar.gz rails-09965710dc7058abd2da3af1a27d7b72de009be6.tar.bz2 rails-09965710dc7058abd2da3af1a27d7b72de009be6.zip |
Merge pull request #11327 from schuetzm/hash-with-indifferent-access-select
Make HashWithIndifferentAccess#select always return the hash.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 0857796036..2d0c56bef5 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -487,6 +487,12 @@ class HashExtTest < ActiveSupport::TestCase assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash end + def test_indifferent_select_returns_a_hash_when_unchanged + hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).select {|k,v| true} + + assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash + end + def test_indifferent_select_bang indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings) indifferent_strings.select! {|k,v| v == 1} |