public class DslKt
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
assertSoftly(kotlin.jvm.functions.Function0<? extends T> assertions)
Run multiple assertions and throw a single error after all are executed if any fail
|
static <T> Matcher<T> |
be(T expected) |
static kotlin.Pair<java.lang.String,java.lang.String> |
diffLargeString(java.lang.String expected,
java.lang.String actual,
int minSizeForDiff)
Returns a formatted diff of the expected and actual input, unless there are no differences,
or the input is too small to bother with diffing, return it returns the input as is.
|
static <T> Matcher<T> |
equalityMatcher(T expected) |
static java.lang.Void |
fail(java.lang.String msg) |
static <T> void |
should(T $receiver,
Matcher<T> matcher) |
static <T> void |
should(T $receiver,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> matcher) |
static <T,U extends T> |
shouldBe(T $receiver,
U any) |
static <T> void |
shouldHave(T $receiver,
Matcher<T> matcher) |
static <T> void |
shouldNot(T $receiver,
Matcher<T> matcher) |
static <T> void |
shouldNotBe(T $receiver,
java.lang.Object any) |
static <T> void |
shouldNotHave(T $receiver,
Matcher<T> matcher) |
public static <T> T assertSoftly(kotlin.jvm.functions.Function0<? extends T> assertions)
Run multiple assertions and throw a single error after all are executed if any fail
This method will run all the assertions inside assertions block, and will collect all failures that may happen. It then compact all of them in a single throwable and throw it instead, or nothing if no assertion fail.
// All assertions below are going to be executed, even when one or multiple fail.
// All the failures are then collected and thrown in one single throwable.
assertSoftly {
"foo" shouldBe "bar"
"foo" shouldBe "foo
"foo" shouldBe "baz"
}
public static <T> Matcher<T> be(T expected)
public static <T> Matcher<T> equalityMatcher(T expected)
public static java.lang.Void fail(java.lang.String msg)
public static <T,U extends T> void shouldBe(T $receiver, U any)
public static <T> void shouldNotBe(T $receiver,
java.lang.Object any)
public static <T> void shouldHave(T $receiver,
Matcher<T> matcher)
public static <T> void should(T $receiver,
Matcher<T> matcher)
public static <T> void shouldNotHave(T $receiver,
Matcher<T> matcher)
public static <T> void shouldNot(T $receiver,
Matcher<T> matcher)
public static <T> void should(T $receiver,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> matcher)
public static kotlin.Pair<java.lang.String,java.lang.String> diffLargeString(java.lang.String expected,
java.lang.String actual,
int minSizeForDiff)
Returns a formatted diff of the expected and actual input, unless there are no differences, or the input is too small to bother with diffing, return it returns the input as is.