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