Created
October 30, 2013 04:22
-
-
Save balopat/7227184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.balopat.timeinjection | |
import org.scalatest.FlatSpec | |
import java.util.Date | |
import org.scalatest.matchers.ShouldMatchers | |
class RealClockSpec extends FlatSpec with ShouldMatchers { | |
"RealClock " should "give back instant between the command before and after" in { | |
val clock: RealClock = new RealClock() | |
val timeBefore = new Date() | |
val realTime = clock.getTime() | |
val timeAfter = new Date() | |
realTime.after(timeBefore) || realTime.equals(timeBefore) should equal(true) | |
realTime.before(timeAfter) || realTime.equals(timeAfter) should equal(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment