Skip to content
Browse files

must matchers added

  • Loading branch information...
1 parent 7064697 commit 61e4923ed0f30668c1b9e220a2cdc29ff20e77db @danseid committed Dec 4, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −1 README.md
  2. +4 −1 src/main/kotlin/org/katchers/Must.kt
View
2 README.md
@@ -148,7 +148,7 @@ Matchers to use on string objects
###Function
-Matchers to use on () : R -> function
+Matchers to use on "() -> Any" function
####fail | !fail with
```kotlin
{throw NullPointerException()} should fail with NullPointerException() //✔
View
5 src/main/kotlin/org/katchers/Must.kt
@@ -21,8 +21,11 @@ package org.katchers
*/
// Any must be
+// Any must
public fun <T>T.must(val verb: BE): AnyBeMatcher<T> = AnyBeMatcher(this)
public fun <T>T.must(val verb: NOTBE): AnyNotBeMatcher<T> = AnyNotBeMatcher(this)
+public fun <T>T.must(val verb: MATCH): AnyMatchMatcher<T> = AnyMatchMatcher(this)
+public fun <T>T.must(val verb: NOTMATCH): AnyNotMatchMatcher<T> = AnyNotMatchMatcher(this);
// String must have | start | end | contain
public fun String.must(val verb: HAVE): StringHaveMatcher = StringHaveMatcher(this)
@@ -40,5 +43,5 @@ public inline fun Number.must(val verb: NOTBE): NumberNotBeMatcher = NumberNotBe
//() -> Unit must fail
-public fun <T: () -> Any>T.must(verb: FAIL): FunctionFailMatcher<T> = FunctionFailMatcher(this)
public fun <T: () -> Any>T.must(verb: NOTFAIL): FunctionNotFailMatcher<T> = FunctionNotFailMatcher(this)
+public fun <T: () -> Any>T.must(verb: FAIL): FunctionFailMatcher<T> = FunctionFailMatcher(this)

0 comments on commit 61e4923

Please sign in to comment.
Something went wrong with that request. Please try again.