- 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
This commit is contained in:
parent
9be89ab215
commit
9287790df8
@ -1549,6 +1549,14 @@ def test_should_return_dup_for_with_indifferent_access
|
||||
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
|
||||
|
@ -8,10 +8,4 @@ def test_reverse_merge
|
||||
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
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user