Skip to content

Instantly share code, notes, and snippets.

@thehenster
Created November 28, 2017 17:55
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 thehenster/a1d4c7389ece55917ad492d5ac415d74 to your computer and use it in GitHub Desktop.
Save thehenster/a1d4c7389ece55917ad492d5ac415d74 to your computer and use it in GitHub Desktop.
Time travel in console
[1] pry(main)> require "active_support/testing/time_helpers"
=> true
[2] pry(main)> include ActiveSupport::Testing::TimeHelpers
=> Object
[3] pry(main)> travel_to("1969-01-01".to_time){ puts Time.current }
1969-01-01 00:00:00 +0100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment