aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2015-01-17 14:55:19 +0530
committerVipul A M <vipulnsward@gmail.com>2015-01-17 14:55:19 +0530
commit9287790df81e6a3cb7fd9697c53b6a060dced154 (patch)
tree27d7f354126973477531a8e2be22d110d9985985
parent9be89ab2157556aafcd86dc68eb135e3da698964 (diff)
downloadrails-9287790df81e6a3cb7fd9697c53b6a060dced154.tar.gz
rails-9287790df81e6a3cb7fd9697c53b6a060dced154.tar.bz2
rails-9287790df81e6a3cb7fd9697c53b6a060dced154.zip
- Moved hwia frozen value assignment test to hash_ext_test similar to other tests
- Fixed the wrong use of with_indifferent_access on hash in the test which failed for isolated tests - Renamed to appropriately specify what the test does
-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