module Timecop
Extended Modules
Defined in:
timecop.crtimecop/exceptions.cr
timecop/time_stack_item.cr
timecop/version.cr
Constant Summary
-
VERSION =
"0.3.0"
Instance Method Summary
-
#freeze(time : Time)
Allows you to run a block of code and "fake" a time throughout the execution of that block.
-
#freeze(time : Time, &block : Time -> )
Allows you to run a block of code and "fake" a time throughout the execution of that block.
-
#frozen?
Returns whether or not Timecop is currently frozen/travelled/scaled
-
#return
Reverts back to system's Time.now
-
#return(&)
Reverts back to system's Time.now
- #safe_mode=(safe)
- #safe_mode?
-
#scale(time : Time, factor : Float64)
Allows you to run a block of code and "scale" a time throughout the execution of that block.
- #scale(time : Time, factor : Float64, &block : Time -> )
-
#travel(time : Time)
Allows you to run a block of code and "fake" a time throughout the execution of that block.
- #travel(time : Time, &block : Time -> )
Instance Method Detail
Allows you to run a block of code and "fake" a time throughout the execution of that block.
Allows you to run a block of code and "fake" a time throughout the execution of that block.
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.
Allows you to run a block of code and "fake" a time throughout the execution of that block.