Closed djgraham closed 8 months ago
@djgraham update changelog request will be accepted. We can plan for this to be the first timecop release of 2024. 2024 is a leap year so looking forward to a lot of fun for tests and testing in this exciting future we're living through!
;p
Thank you for the PR approval @joshuacronemeyer ! I've added in an additional commit to for the entry to History.md
Hopefully if these are all good they can be merged in 🤞
Thanks again !
In a recent Timecop release (0.9.7, commit c57a1fc), a fix was made to the boolean method
#frozen?
which previously returnedtrue
if Timecop was active at that instance in time (frozen, scaled or travelled). This method was changed so that only returnedtrue
if Timecop was in a frozen state. Once this change was made it was no longer possible to check if Timecop was in ascaled
ortravelled
state.As a result of this change, our automated test suite, which relied on the previous behaviour of
frozen?
failed (we used it to check if Timecop present in any way in a database helper, and it affected how our automated factory objects were being created where dates are involved). We discovered this after investigating a dependabot automated gem update failure.This PR exposes two additional methods
scaled?
andtravelled?
to allow a consumer to check for these states. I did consider an alternative methodactive?
which would have been the previousfrozen?
behaviour, but decided to be explicit in these new methods.I've added in some additional tests to cover what I think are most of the examples.
(Note: will update changelog if this PR is likely to get merged)
Thank you