Closed jamiemccarthy closed 1 year ago
@jamiemccarthy this seems like a nice PR. Thank you. When you get the chance can you change it to not use safe navigation? For older ruby compatibility we can't use that.
@jamiemccarthy this seems like a nice PR. Thank you. When you get the chance can you change it to not use safe navigation? For older ruby compatibility we can't use that.
Sure thing, sorry I missed that in the first place!
@joshuacronemeyer Let me know if there's anything else I can do!
@jamiemccarthy thanks for the reminder. Would you mind getting your branch up to date with master? I'm happy to merge this when that's done and tests pass.
Hey there @joshuacronemeyer, you merged in master (f49cea095d3a) already last month, and I see a green check on d274f02360f2b77b4f7611797c40c3bcf448d39c, so I think we're good to go!
I see, yes -- it looks like my addition at the top of History.md
collides with the changelog for 0.9.6. It will merge cleanly but a rebase will require resolving that manually.
I've rebased and resolved that as a new branch, https://github.com/jamiemccarthy/timecop/tree/jm-frozen-check-rebased , which you're welcome to use. If you'd like me to force-push that to this PR, just let me know.
While fine-tuning an application's use of Timecop, I noticed that
frozen?
was returning true if any mock type was active, not just:freeze
but also:travel
or:scale
.I believe this was not the intended meaning of the method, neither according to its name nor as described in the class's code.
This PR updates
frozen?
so it returns true only if there is at least one mock type on the stack and the last (currently active) mock type is in fact:frozen
.I ran the test suite in the Dockerfile, but I haven't run it against the other ruby's in the CI matrix.
The first commit is unrelated and just adds a few more tests that I thought might be useful. If you want to skip it, that's fine. The other three commits add tests, fix the method, and update the History, respectively.
Comments and questions welcome, and if you'd like me to refactor this PR in any way I'm happy to! Thanks for writing this very useful gem!