Class Extension Debugging Exercises my_merge SOLVED

I’m having trouble figuring out the solution for my_merge.

The specs say it should yield each element to the block. However, the expected value is only [:b, 2, 3]

Obviously this isn’t every element but only the key that appears in both hashes. But if I only pass in whatever key is in both hashes, then the fourth test fails since :c won’t be added into the resulting hash

Is the test wrong or am I missing something?

I guess I was too focused on using yield for every element if a block is given. I just added the default merging line for elements only in the second hash and it fixed it!