Created
March 12, 2020 17:11
-
-
Save aks/b4f824f2075a160f546bd0d06c962df8 to your computer and use it in GitHub Desktop.
Rspec shared_context to freeze time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FREEZE_DATETIME = '2020/02/20 10:20:30 GMT' | |
shared_context 'freeze_time' do | |
around do |example| | |
Timecop.freeze(FREEZE_DATETIME) | |
example.run | |
Timecop.return | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment