Created
April 15, 2018 10:54
-
-
Save rozkminiacz/7dd77fb193fb4d3b2af20a8923d7eae0 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
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