module

Timecop

Constants

VERSION = "0.1.2"

Instance methods

freeze(time : Time)

Allows you to run a block of code and "fake" a time throughout the execution of that block.

Source
freeze(time : Time, &block : Time -> )

Allows you to run a block of code and "fake" a time throughout the execution of that block.

Source
frozen?

Returns whether or not Timecop is currently frozen/travelled/scaled

Source
return

Reverts back to system's Time.now

Source
return

Reverts back to system's Time.now

Source
safe_mode=(safe)
Source
safe_mode?
Source
scale(time : Time, factor : Float64)

Allows you to run a block of code and "scale" a time throughout the execution of that block. The first argument is a scaling factor, for example: Timecop.scale(2) do ... time will 'go' twice as fast here end Returns the value of the block if one is given, or the mocked time.

Source
scale(time : Time, factor : Float64, &block : Time -> )
Source
travel(time : Time)

Allows you to run a block of code and "fake" a time throughout the execution of that block.

Source
travel(time : Time, &block : Time -> )
Source

Nested types