Class: Test::Unit::TestCase
- Inherits:
-
Object
- Object
- Test::Unit::TestCase
- Defined in:
- lib/time_warp.rb
Instance Method Summary collapse
-
#pretend_now_is(*args) ⇒ Object
Time warp to the specified time for the duration of the passed block.
Instance Method Details
#pretend_now_is(*args) ⇒ Object
Time warp to the specified time for the duration of the passed block.
9 10 11 12 13 14 15 16 |
# File 'lib/time_warp.rb', line 9 def pretend_now_is(*args) begin Time.testing_offset = Time.now - time_from(*args) yield ensure Time.testing_offset = 0 end end |