test/unit/ut_26_deep.rb in ruote-2.3.0.1 vs test/unit/ut_26_deep.rb in ruote-2.3.0.2
- old
+ new
@@ -125,7 +125,21 @@
assert_equal(
{ 'a' => 2, 'b' => { 'a' => 4 } },
h)
end
+
+ def test_deep_mutate_key_mutation
+
+ h = { 'a' => { 'a' => 'b' } }
+
+ Ruote.deep_mutate(h, 'a') do |coll, k, v|
+ coll.delete('a')
+ coll['A'] = v
+ end
+
+ assert_equal(
+ { 'A' => { 'A' => 'b' } },
+ h)
+ end
end