Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactoring

  • Loading branch information...
commit d26716fc8ef5a91472ff76e475b64563ab308d36 1 parent 239dfb4
Daniel Seidler @Work authored
View
3  src/main/kotlin/spec/matchers/AnyMatcher.kt
@@ -11,12 +11,11 @@ import kotlin.test.*
open class AnyMatcher<T> (val target: T, val verb: Verb) {
fun equal(value: T){
when (verb) {
- Verb.BE -> {if (!value.equals(target)) fail(value, target)}
+ Verb.BE -> {if (value != target) fail(value, target)}
Verb.NOTBE -> {if (value == target) fail(value, target)}
else -> notSupported()
}
}
-
open fun any(values: List<T>) {
when (verb) {
Verb.BE -> {
View
8 src/test/kotlin/AllTest.kt
@@ -8,5 +8,11 @@ import org.junit.runners.Suite;
import org.junit.runner.RunWith;
RunWith(javaClass<Suite>())
-Suite.SuiteClasses(javaClass<VerbTest>(), javaClass<AnyMatchersTest>(), javaClass<StringMatcherTest>(), javaClass<ShouldTest>())
+Suite.SuiteClasses(
+ javaClass<VerbTest>(),
+ javaClass<AnyMatchersTest>(),
+ javaClass<StringMatcherTest>(),
+ javaClass<ShouldTest>(),
+ javaClass<FunctionMatcherTest>()
+)
public class AllTest {}
View
3  src/test/kotlin/StringMatcherTest.kt
@@ -6,7 +6,6 @@
import org.junit.Test as test
import spec.matchers.*
-import sun.management.counter.Units
public class StringMatcherTest {
test fun length() {
@@ -27,7 +26,7 @@ public class StringMatcherTest {
}
test fun containAny() {
- "abc" should contain any of("a" ,"b" ,"c")
+ "abc" should contain any of("a", "b", "c")
"abc" should !contain any of("d", "e", "f")
}
Please sign in to comment.
Something went wrong with that request. Please try again.