Created
March 12, 2020 17:11
Rspec shared_context to freeze time
This file contains 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