From 54a38127e1793ba07500d1c985ed74a470d4cc31 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Wed, 29 Feb 2012 09:19:10 +0000 Subject: [PATCH] made it easier to pass fails blocks --- kunit/src/main/kotlin/Test.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kunit/src/main/kotlin/Test.kt b/kunit/src/main/kotlin/Test.kt index 30fbd211eca..e094a0066fc 100644 --- a/kunit/src/main/kotlin/Test.kt +++ b/kunit/src/main/kotlin/Test.kt @@ -65,7 +65,7 @@ inline fun expect(expected: T, message: String, block: ()-> T) { } /** Asserts that given function block fails by throwing an exception */ -fun fails(block: ()-> Any): Exception? { +fun fails(block: ()-> Unit): Exception? { try { block() Assert.fail("Expected an exception to be thrown")