Skip to content

Commit

Permalink
Remove @throws Assertion Error kdoc from assertion functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jGleitz committed Dec 23, 2020
1 parent 3508b57 commit ea27254
Show file tree
Hide file tree
Showing 178 changed files with 345 additions and 1,411 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import ch.tutteli.kbox.glue
* Expects that the subject of the assertion is (equal to) [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBe
*/
fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }
Expand All @@ -21,8 +20,7 @@ fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }
* Expects that the subject of the assertion is not (equal to) [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBe
*/
fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expected) }
Expand All @@ -31,8 +29,7 @@ fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expec
* Expects that the subject of the assertion is the same instance as [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isSameAs
*/
fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(expected) }
Expand All @@ -41,8 +38,7 @@ fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(exp
* Expects that the subject of the assertion is not the same instance as [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNotSameAs
*/
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) }
Expand All @@ -67,8 +63,7 @@ fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit
* is `null` or is not `null` and holds all assertions [assertionCreatorOrNull] creates.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBeNullIfNullGivenElse
*/
fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
Expand All @@ -79,8 +74,7 @@ fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
* Expects that the subject of the assertion is not null and changes the subject to the non-nullable version.
*
* @return An [Expect] with the non-nullable type [T] (was `T?` before).
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNullFeature
*/
inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> =
Expand All @@ -91,8 +85,7 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> =
* that it holds all assertions the given [assertionCreator] creates.
*
* @return An [Expect] with the non-nullable type [T] (was `T?` before)
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNull
*/
inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: Expect<T>.() -> Unit): Expect<T> =
Expand All @@ -115,8 +108,7 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: E
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
*
* @return An [Expect] with the new type [TSub].
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isAFeature
*/
inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
Expand Down Expand Up @@ -161,8 +153,7 @@ inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
* `assert(listOf(1, 2)).isA<List<String>>{}` holds, even though `List<Int>` is clearly not a `List<String>`.
*
* @return An [Expect] with the new type [TSub].
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isA
*/
inline fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub> =
Expand Down Expand Up @@ -200,8 +191,7 @@ infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> =
* Expects that the subject of the assertion is not (equal to) [expected] and [otherValues].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.13.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNoneOf
Expand All @@ -216,7 +206,6 @@ fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
* are passed. This function expects [IterableLike] (which is a typealias for [Any]) to avoid cluttering the API.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
* @throws IllegalArgumentException in case the iterable is empty.
*
* @since 0.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ val <T : CharSequence> Expect<T>.containsNot: NotCheckerStep<T, NotSearchBehavio
* `contains("a", "a")`
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
* [CharSequence], [Number] or [Char].
*
Expand All @@ -80,8 +79,7 @@ fun <T : CharSequence> Expect<T>.contains(
* so that you can mix [String] and [Int] for instance.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.containsNot
*/
fun <T : CharSequence> Expect<T>.containsNot(
Expand Down Expand Up @@ -110,8 +108,7 @@ fun <T : CharSequence> Expect<T>.containsNot(
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.containsRegexString
*/
fun <T : CharSequence> Expect<T>.containsRegex(pattern: String, vararg otherPatterns: String): Expect<T> =
Expand All @@ -138,8 +135,7 @@ fun <T : CharSequence> Expect<T>.containsRegex(pattern: String, vararg otherPatt
* @param otherPatterns Additional patterns which are expected to have a match against the input of the search.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.containsRegex
Expand All @@ -151,8 +147,7 @@ fun <T : CharSequence> Expect<T>.containsRegex(pattern: Regex, vararg otherPatte
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsWith
*/
fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T> =
Expand All @@ -162,8 +157,7 @@ fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) starts with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsWithChar
*
* @since 0.9.0
Expand All @@ -175,8 +169,7 @@ fun <T : CharSequence> Expect<T>.startsWith(expected: Char): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsNotWith
*/
fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T> =
Expand All @@ -186,8 +179,7 @@ fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T
* Expects that the subject of the assertion (a [CharSequence]) does not start with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.startsNotWithChar
Expand All @@ -200,8 +192,7 @@ fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsWith
*/
fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T> =
Expand All @@ -211,8 +202,7 @@ fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) ends with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsWithChar
Expand All @@ -224,8 +214,7 @@ fun <T : CharSequence> Expect<T>.endsWith(expected: Char): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsNotWith
*/
fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T> =
Expand All @@ -235,8 +224,7 @@ fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T>
* Expects that the subject of the assertion (a [CharSequence]) does not end with [expected].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.endsNotWithChar
*/
Expand All @@ -248,8 +236,7 @@ fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isEmpty].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isEmpty
*/
fun <T : CharSequence> Expect<T>.isEmpty(): Expect<T> =
Expand All @@ -259,8 +246,7 @@ fun <T : CharSequence> Expect<T>.isEmpty(): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isNotEmpty].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isNotEmpty
*/
fun <T : CharSequence> Expect<T>.isNotEmpty(): Expect<T> =
Expand All @@ -270,8 +256,7 @@ fun <T : CharSequence> Expect<T>.isNotEmpty(): Expect<T> =
* Expects that the subject of the assertion (a [CharSequence]) [CharSequence].[kotlin.text.isNotBlank].
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.isNotBlank
*/
fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T> =
Expand All @@ -283,8 +268,7 @@ fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T> =
* In contrast to [containsRegex] it does not look for a partial match but for an entire match.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.matches
Expand All @@ -298,8 +282,7 @@ fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T> =
* In contrast to `containsNot.regex` it does not look for a partial match but for an entire match.
*
* @return An [Expect] for the current subject of the assertion.
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.CharSequenceAssertionsSpec.mismatches
Expand Down
Loading

0 comments on commit ea27254

Please sign in to comment.