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 067410d
Show file tree
Hide file tree
Showing 194 changed files with 18 additions and 1,272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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
*/
Expand All @@ -21,7 +20,6 @@ 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
*/
Expand All @@ -31,7 +29,6 @@ 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
*/
Expand All @@ -41,7 +38,6 @@ 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
*/
Expand All @@ -67,7 +63,6 @@ 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
*/
Expand All @@ -79,7 +74,6 @@ 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
*/
Expand All @@ -91,7 +85,6 @@ 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
*/
Expand All @@ -115,7 +108,6 @@ 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
*/
Expand Down Expand Up @@ -161,7 +153,6 @@ 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
*/
Expand Down Expand Up @@ -200,7 +191,6 @@ 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
*
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 @@ -283,7 +283,7 @@ fun Expect<DoubleArray>.asList(): Expect<List<Double>> =
* @return The newly created [Expect] for the transformed subject.
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.doubleArrAsList
*/
@JvmName("doubleArrAsList")
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,7 +79,6 @@ 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
*/
Expand Down Expand Up @@ -110,7 +108,6 @@ 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
*/
Expand Down Expand Up @@ -138,7 +135,6 @@ 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
*
Expand All @@ -151,7 +147,6 @@ 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
*/
Expand All @@ -162,7 +157,6 @@ 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
*
Expand All @@ -175,7 +169,6 @@ 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
*/
Expand All @@ -186,7 +179,6 @@ 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
*
Expand All @@ -200,7 +192,6 @@ 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
*/
Expand All @@ -211,7 +202,6 @@ 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
*
Expand All @@ -224,7 +214,6 @@ 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
*/
Expand All @@ -235,7 +224,6 @@ 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,7 +236,6 @@ 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
*/
Expand All @@ -259,7 +246,6 @@ 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
*/
Expand All @@ -270,7 +256,6 @@ 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
*/
Expand All @@ -283,7 +268,6 @@ 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
*
Expand All @@ -298,7 +282,6 @@ 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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import kotlin.jvm.JvmName
* @param expected The value which is expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
*/
fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
Expand Down Expand Up @@ -66,7 +65,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharS
* @param otherExpected Additional values which are expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
* [CharSequence], [Number] or [Char].
*/
Expand All @@ -91,7 +89,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.values(
* @param expected The value which is expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
*/
@JvmName("valueIgnoringCase")
Expand Down Expand Up @@ -122,7 +119,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.value(
* @param otherExpected Additional values which are expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
* [CharSequence], [Number] or [Char].
*/
Expand All @@ -148,7 +144,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.values(
* @param expected The value which is expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char].
*/
fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expected: CharSequenceOrNumberOrChar): Expect<T> =
Expand All @@ -174,7 +169,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(expe
* @param otherExpected Additional values which are expected to be contained within 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.
* @throws IllegalArgumentException in case [expected] or one of the [otherExpected] is not a
* [CharSequence], [Number] or [Char].
*/
Expand Down Expand Up @@ -202,7 +196,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.values(
* @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.
*/
fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
pattern: String,
Expand All @@ -228,7 +221,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
* @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
*/
Expand Down Expand Up @@ -257,7 +249,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
* @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.
*/
@JvmName("regexIgnoringCase")
fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(
Expand Down Expand Up @@ -287,7 +278,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(
* @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.
*/
fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(
pattern: String,
Expand All @@ -309,7 +299,6 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within 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.
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
* [expectedIterableLike] does not have elements (is empty).
*
Expand Down Expand Up @@ -337,7 +326,6 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.elementsOf(
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within 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.
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
* [expectedIterableLike] does not have elements (is empty).
*
Expand Down Expand Up @@ -365,7 +353,6 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.elementsOf(
* @param expectedIterableLike The [IterableLike] whose elements are expected to be contained within 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.
* @throws IllegalArgumentException in case [expectedIterableLike] is not an [Iterable], [Sequence] or one of the [Array] types or the given
* [expectedIterableLike] does not have elements (is empty).
*
Expand Down
Loading

0 comments on commit 067410d

Please sign in to comment.