Skip to content

Instantly share code, notes, and snippets.

@keithpitt
Last active February 15, 2017 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithpitt/f66f5348864bdecd79954e696249c828 to your computer and use it in GitHub Desktop.
Save keithpitt/f66f5348864bdecd79954e696249c828 to your computer and use it in GitHub Desktop.
# Add this file to `spec/support/timecop.rb`
#
# Usage:
#
# it "should touch the `updated_at` attribute", :timecop do
# ...
# end
require 'timecop'
RSpec.configure do |config|
config.before(:each, timecop: true) do |example|
Timecop.freeze
end
config.after(:each) do
Timecop.return
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment