Skip to content

Instantly share code, notes, and snippets.

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 rozkminiacz/7dd77fb193fb4d3b2af20a8923d7eae0 to your computer and use it in GitHub Desktop.
Save rozkminiacz/7dd77fb193fb4d3b2af20a8923d7eae0 to your computer and use it in GitHub Desktop.
class DistanceConverterSpecificiation : Spek({
describe("distance converter") {
val testCases = mapOf(
61888.123 to ">50 km",
38777.23 to "38.8 km",
16984.44 to "17.0 km",
987.98 to "988 m"
)
val converter = DistanceConverter()
testCases.forEach { value, expectedValue ->
on("$value"){
it("should print $expectedValue"){
assertTrue(converter.convert(value).contentEquals(expectedValue))
}
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment