Skip to content

Instantly share code, notes, and snippets.

@chrissie1
Created April 23, 2014 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrissie1/11214114 to your computer and use it in GitHub Desktop.
Save chrissie1/11214114 to your computer and use it in GitHub Desktop.
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)
})
})
}
@hhariri
Copy link

hhariri commented Apr 23, 2014

IT also makes me realize we need to rename givenData and also maybe add annotation title.

@hhariri
Copy link

hhariri commented Apr 23, 2014

IT also makes me realize we need to rename givenData and also maybe add annotation title.

@hhariri
Copy link

hhariri commented Apr 23, 2014

IT also makes me realize we need to rename givenData and also maybe add annotation title.

@chrissie1
Copy link
Author

I get IT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment