diff options
author | Stefan Schüßler <mail@stefanschuessler.de> | 2019-01-29 11:49:23 +0100 |
---|---|---|
committer | Stefan Schüßler <mail@stefanschuessler.de> | 2019-01-30 08:31:37 +0100 |
commit | fc6a525341d7a287740d3e61beaccabd3e65bdc3 (patch) | |
tree | 900b3023ae291e8567ef9551b469ebedee5fa792 /activesupport/test | |
parent | deac9ec430f652ddea485c92f39f7b00ebb4d4a5 (diff) | |
download | rails-fc6a525341d7a287740d3e61beaccabd3e65bdc3.tar.gz rails-fc6a525341d7a287740d3e61beaccabd3e65bdc3.tar.bz2 rails-fc6a525341d7a287740d3e61beaccabd3e65bdc3.zip |
Add HashWithIndifferentAccess#assoc
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/hash_with_indifferent_access_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb index f81e0dc70f..8a39672609 100644 --- a/activesupport/test/hash_with_indifferent_access_test.rb +++ b/activesupport/test/hash_with_indifferent_access_test.rb @@ -447,6 +447,14 @@ class HashWithIndifferentAccessTest < ActiveSupport::TestCase assert_instance_of ActiveSupport::HashWithIndifferentAccess, indifferent_strings end + def test_indifferent_assoc + indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings) + key, value = indifferent_strings.assoc(:a) + + assert_equal("a", key) + assert_equal(1, value) + end + def test_indifferent_compact hash_contain_nil_value = @strings.merge("z" => nil) hash = ActiveSupport::HashWithIndifferentAccess.new(hash_contain_nil_value) |