added working test casres for groovy style markup builders

This commit is contained in:
James Strachan
2012-01-04 12:59:37 +00:00
parent 8cfc979c10
commit 8c40aa58af
4 changed files with 175 additions and 52 deletions
+11
View File
@@ -102,6 +102,17 @@ fun fails(block: ()-> Any) {
block()
Assert.fail("Expected an exception to be thrown")
} catch (e: Exception) {
println("Caught excepted exception: $e")
// OK
}
}
fun <T: Exception> failsWith(block: ()-> Any) {
try {
block()
Assert.fail("Expected an exception to be thrown")
} catch (e: T) {
println("Caught excepted exception: $e")
// OK
}
}