- It's best to avoid subclassing core types like Hash. - Remove runtime module extensions, since that blows MRIs method caches and has an affect on perf. - Instantiation was a two part process: `.new` followed by `process`. Conceptually, these belong together, so switch to using a single method for instantiation. Two gotchas I discovered: - The `include` matcher didn't initially work properly with `Metadata`. It uses an `is_a?(Hash)` check to know how to treat the object. To solve this, we override `is_a?` to return true for Hash. - `dup` didn't work as expected. `dup` is used to get a copy that can be modified without affecting the original; however, `dup` was simply duping the wrapping object, and each retained a reference to the same wrapped hash, causing changes on one to show up on the other. I override `dup` and `clone` to address this.
This makes it far easier to test it in isolation without need for any gymnastics.
This reverts commit e7d7856.
Problem occurred for me running guard-jruby-rspec on windows.