org.specs2.time
Use Time.now in your app instead of System.currentTimeMillis, and unit tests will be able to adjust the current time to verify timeouts and other time-dependent behavior, without calling sleep.
Time.now
System.currentTimeMillis
sleep
Freeze the clock.
Freeze the clock. Time will not pass until reset.
Use
Time.now
in your app instead ofSystem.currentTimeMillis
, and unit tests will be able to adjust the current time to verify timeouts and other time-dependent behavior, without callingsleep
.