Created
April 23, 2014 12:52
-
-
Save chrissie1/11214114 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
val data = listOf( | |
-1 to "one second ago", | |
-10 to "10 seconds ago", | |
-59 to "59 seconds ago", | |
-60 to "a minute ago", | |
1 to "one second from now", | |
10 to "10 seconds from now", | |
59 to "59 seconds from now", | |
60 to "a minute from now" | |
) | |
givenData("timeunit in seconds" ,data) { | |
val (input, excpected) = it | |
on("calling humanize with ${input}", { | |
val datetouse = GregorianCalendar(2014,Calendar.JANUARY, 5).getTime() | |
val (input, excpected) = it | |
val cal = GregorianCalendar() | |
cal.setTime(input) | |
cal.add(Calendar.SECOND, input) | |
val actual = cal.getTime().humanize(input) | |
it("should be ${expected}", { | |
shouldEqual(expected, actual) | |
}) | |
}) | |
} |
IT also makes me realize we need to rename givenData and also maybe add annotation title.
I get IT.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IT also makes me realize we need to rename givenData and also maybe add annotation title.