aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-01-17 10:20:58 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2015-01-17 10:20:58 -0200
commit89eb1ae69b64197eccd0eae3a985184acbf4f9ac (patch)
tree27d7f354126973477531a8e2be22d110d9985985
parent9be89ab2157556aafcd86dc68eb135e3da698964 (diff)
parent9287790df81e6a3cb7fd9697c53b6a060dced154 (diff)
downloadrails-89eb1ae69b64197eccd0eae3a985184acbf4f9ac.tar.gz
rails-89eb1ae69b64197eccd0eae3a985184acbf4f9ac.tar.bz2
rails-89eb1ae69b64197eccd0eae3a985184acbf4f9ac.zip
Merge pull request #18562 from vipulnsward/fix-broken-hwai-frozen-tet
Fix hwia isolated tests
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb8
-rw-r--r--activesupport/test/hash_with_indifferent_access_test.rb8
2 files changed, 9 insertions, 7 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 3d2f50ce49..e10bee5e00 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -1549,6 +1549,14 @@ class HashToXmlTest < ActiveSupport::TestCase
assert_not_same hash_wia, hash_wia.with_indifferent_access
end
+
+ def test_allows_setting_frozen_array_values_with_indifferent_access
+ value = [1, 2, 3].freeze
+ hash = HashWithIndifferentAccess.new
+ hash[:key] = value
+ assert_equal hash[:key], value
+ end
+
def test_should_copy_the_default_value_when_converting_to_hash_with_indifferent_access
hash = Hash.new(3)
hash_wia = hash.with_indifferent_access
diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb
index 880457386e..1facd691fa 100644
--- a/activesupport/test/hash_with_indifferent_access_test.rb
+++ b/activesupport/test/hash_with_indifferent_access_test.rb
@@ -8,10 +8,4 @@ class HashWithIndifferentAccessTest < ActiveSupport::TestCase
assert_equal :old_value, hash[:key]
end
- def test_frozen_value
- value = [1, 2, 3].freeze
- hash = {}.with_indifferent_access
- hash[:key] = value
- assert_equal hash[:key], value
- end
-end \ No newline at end of file
+end