`dup` only produces a shallow duplicate, which means that any mutation on referenced objects will not be isolated by this.  To get a deep dup for full isolation you can use `Marshal.load(Marshal.dump config)`

Also, it's not clear to me how this even works: you are yielding a dup of config, but it's not what `RSpec.configuration` references, so it seems like within the block, mutations to the yielded `config` argument won't affect anything that tries to use `RSpec.configuration`.