-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove deep_dup usage in tests, use helper methods instead #117
Comments
I don't know the full context of this issue, but rather than using dup, why not just have separate specs? |
I found a weird edge case when doing the mentioned PR, where an error would arise depending of the test order of interpretation, which was non-trivial. The main culprit was that all tests were using a deep_dup copy of those frame hashes, and these weren't really deep-dup'ed (because ruby :) ). Long story short, one should be using fresh hashes for each test instead of relying on deep_dup quirks. And helper methods should be the way to go. |
To be honest, the structure of this gem and the specs leaves a lot to be desired, I hope I can spend some time on improving it slowly with small steps. |
As I'm sure you already are, I welcome you to improve the specs, as I have been doing recently. |
Coming from #116 (comment)
The deep_dup method (the same as in ActiveSupport) shows some edge cases where it's mutating the hashes used in the tests. Whether this is a ruby bug or not is not the matter, but this could be fixed by relying on helper methods instead, which could be injected in the describe blocks where they are used.
The text was updated successfully, but these errors were encountered: