Skip to content
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

Closed
HoneyryderChuck opened this issue Feb 2, 2018 · 4 comments
Closed

remove deep_dup usage in tests, use helper methods instead #117

HoneyryderChuck opened this issue Feb 2, 2018 · 4 comments

Comments

@HoneyryderChuck
Copy link
Collaborator

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.

@ioquatix
Copy link
Collaborator

ioquatix commented Jul 2, 2018

I don't know the full context of this issue, but rather than using dup, why not just have separate specs?

@HoneyryderChuck
Copy link
Collaborator Author

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.

@ioquatix
Copy link
Collaborator

ioquatix commented Jul 2, 2018

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.

@ioquatix
Copy link
Collaborator

ioquatix commented Jul 2, 2018

As I'm sure you already are, I welcome you to improve the specs, as I have been doing recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants