Skip to content

Commit

Permalink
Merge pull request #748 from jGleitz/rename-to-expectation
Browse files Browse the repository at this point in the history
🚧 Rename ‘Assertions’ to ‘Expectations’
  • Loading branch information
robstoll authored Jan 10, 2021
2 parents 79460ae + f85a8b3 commit 57a3e5d
Show file tree
Hide file tree
Showing 384 changed files with 702 additions and 755 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/good_first_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Following the things you need to do:
- [ ] provide a val which returns `Expect<T>` (see yzAssertions.kt as a guideline)
- [ ] provide a fun which expects an `assertionCreator`-lambda and returns `Expect<AB>` (see yzAssertions.kt as a guideline)
- [ ] add `@since 0.16.0` (adapt to current [milestone](https://github.com/robstoll/atrium/milestones)) to KDOC
- [ ] extend or write a separate Spec named XyAssertionsSpec in specs-common (see for instance YzAssertionsSpec) and extend it in atrium-api-fluent-en_GB-common/src/test
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs-common (see for instance YzExpectationsSpec) and extend it in atrium-api-fluent-en_GB-common/src/test

*api-infix*
- [ ] provide a val which returns `Expect<T>` (see yzAssertions.kt as a guideline)
- [ ] provide a fun which expects an `assertionCreator`-lambda and returns `Expect<AB>` (see yzAssertions.kt as a guideline)
- [ ] add `@since 0.16.0` (adapt to current [milestone](https://github.com/robstoll/atrium/milestones)) to KDOC
- [ ] extend or write a separate Spec named XyAssertionsSpec in specs-common (see for instance YzAssertionsSpec) and extend it in atrium-api-infix-en_GB-common/src/test
- [ ] extend or write a separate Spec named XyExpectationsSpec in specs-common (see for instance YzExpectationsSpec) and extend it in atrium-api-infix-en_GB-common/src/test


## Non-Code related feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ch.tutteli.kbox.glue
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBe
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.toBe
*/
fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }

Expand All @@ -21,7 +21,7 @@ fun <T> Expect<T>.toBe(expected: T): Expect<T> = _logicAppend { toBe(expected) }
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBe
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.notToBe
*/
fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expected) }

Expand All @@ -30,7 +30,7 @@ fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expec
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isSameAs
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isSameAs
*/
fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(expected) }

Expand All @@ -39,7 +39,7 @@ fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(exp
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNotSameAs
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isNotSameAs
*/
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) }

Expand All @@ -53,7 +53,7 @@ fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSame
*
* @since 0.15.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.because
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.because
*/
fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit): Expect<T> =
_logicAppend { because(reason, assertionCreator) }
Expand All @@ -64,7 +64,7 @@ fun <T> Expect<T>.because(reason: String, assertionCreator: Expect<T>.() -> Unit
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBeNullIfNullGivenElse
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.toBeNullIfNullGivenElse
*/
fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
assertionCreatorOrNull: (Expect<T>.() -> Unit)?
Expand All @@ -75,7 +75,7 @@ fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(
*
* @return An [Expect] with the non-nullable type [T] (was `T?` before).
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNullFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.notToBeNullFeature
*/
inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> =
_logic.notToBeNullButOfType(T::class).transform()
Expand All @@ -86,7 +86,7 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(): Expect<T> =
*
* @return An [Expect] with the non-nullable type [T] (was `T?` before)
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeNull
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.notToBeNull
*/
inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: Expect<T>.() -> Unit): Expect<T> =
_logic.notToBeNullButOfType(T::class).transformAndAppend(assertionCreator)
Expand All @@ -109,7 +109,7 @@ inline fun <reified T : Any> Expect<T?>.notToBeNull(noinline assertionCreator: E
*
* @return An [Expect] with the new type [TSub].
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isAFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isAFeature
*/
inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
_logic.isA(TSub::class).transform()
Expand Down Expand Up @@ -154,7 +154,7 @@ inline fun <reified TSub : Any> Expect<*>.isA(): Expect<TSub> =
*
* @return An [Expect] with the new type [TSub].
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isA
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isA
*/
inline fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub> =
_logic.isA(TSub::class).transformAndAppend(assertionCreator)
Expand All @@ -168,7 +168,7 @@ inline fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: Expect<
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.andFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.andFeature
*/
inline val <T> Expect<T>.and: Expect<T> get() = this

Expand All @@ -182,7 +182,7 @@ inline val <T> Expect<T>.and: Expect<T> get() = this
*
* @return An [Expect] for the current subject of the assertion.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.and
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.and
*/
infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> =
addAssertionsCreatedBy(assertionCreator)
Expand All @@ -194,7 +194,7 @@ infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T> =
*
* @since 0.13.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNoneOf
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isNoneOf
*/
fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
_logicAppend { isNotIn(expected glue otherValues) }
Expand All @@ -210,7 +210,7 @@ fun <T> Expect<T>.isNoneOf(expected: T, vararg otherValues: T): Expect<T> =
*
* @since 0.13.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNotIn
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyExpectationsSamples.isNotIn
*/
inline fun <reified T> Expect<T>.isNotIn(expected: IterableLike): Expect<T> =
_logicAppend { isNotIn(iterableLikeToIterable(expected)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlin.jvm.JvmName
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.asListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.asListFeature
*/
fun <E> Expect<out Array<out E>>.asList(): Expect<List<E>> =
_logic.changeSubject.unreported { it.asList() }
Expand All @@ -31,7 +31,7 @@ fun <E> Expect<out Array<out E>>.asList(): Expect<List<E>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.asList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.asList
*/
fun <E> Expect<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<E>> =
apply { asList().addAssertionsCreatedBy(assertionCreator) }
Expand All @@ -47,7 +47,7 @@ fun <E> Expect<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): E
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.asListEOut
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.asListEOut
*/
@JvmName("asListEOut")
fun <E> Expect<Array<out E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<out E>> =
Expand All @@ -63,7 +63,7 @@ fun <E> Expect<Array<out E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.byteArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.byteArrAsListFeature
*/
@JvmName("byteArrAsList")
fun Expect<ByteArray>.asList(): Expect<List<Byte>> =
Expand All @@ -80,7 +80,7 @@ fun Expect<ByteArray>.asList(): Expect<List<Byte>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.byteArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.byteArrAsList
*/
@JvmName("byteArrAsList")
fun Expect<ByteArray>.asList(assertionCreator: Expect<List<Byte>>.() -> Unit): Expect<ByteArray> =
Expand All @@ -97,7 +97,7 @@ fun Expect<ByteArray>.asList(assertionCreator: Expect<List<Byte>>.() -> Unit): E
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.charArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.charArrAsListFeature
*/
@JvmName("charArrAsList")
fun Expect<CharArray>.asList(): Expect<List<Char>> =
Expand All @@ -114,7 +114,7 @@ fun Expect<CharArray>.asList(): Expect<List<Char>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.charArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.charArrAsList
*/
@JvmName("charArrAsList")
fun Expect<CharArray>.asList(assertionCreator: Expect<List<Char>>.() -> Unit): Expect<CharArray> =
Expand All @@ -131,7 +131,7 @@ fun Expect<CharArray>.asList(assertionCreator: Expect<List<Char>>.() -> Unit): E
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.shortArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.shortArrAsListFeature
*/
@JvmName("shortArrAsList")
fun Expect<ShortArray>.asList(): Expect<List<Short>> =
Expand All @@ -148,7 +148,7 @@ fun Expect<ShortArray>.asList(): Expect<List<Short>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.shortArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.shortArrAsList
*/
@JvmName("shortArrAsList")
fun Expect<ShortArray>.asList(assertionCreator: Expect<List<Short>>.() -> Unit): Expect<ShortArray> =
Expand All @@ -165,7 +165,7 @@ fun Expect<ShortArray>.asList(assertionCreator: Expect<List<Short>>.() -> Unit):
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.intArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.intArrAsListFeature
*/
@JvmName("intArrAsList")
fun Expect<IntArray>.asList(): Expect<List<Int>> =
Expand All @@ -182,7 +182,7 @@ fun Expect<IntArray>.asList(): Expect<List<Int>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.intArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.intArrAsList
*/
@JvmName("intArrAsList")
fun Expect<IntArray>.asList(assertionCreator: Expect<List<Int>>.() -> Unit): Expect<IntArray> =
Expand All @@ -199,7 +199,7 @@ fun Expect<IntArray>.asList(assertionCreator: Expect<List<Int>>.() -> Unit): Exp
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.longArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.longArrAsListFeature
*/
@JvmName("longArrAsList")
fun Expect<LongArray>.asList(): Expect<List<Long>> =
Expand All @@ -216,7 +216,7 @@ fun Expect<LongArray>.asList(): Expect<List<Long>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.longArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.longArrAsList
*/
@JvmName("longArrAsList")
fun Expect<LongArray>.asList(assertionCreator: Expect<List<Long>>.() -> Unit): Expect<LongArray> =
Expand All @@ -233,7 +233,7 @@ fun Expect<LongArray>.asList(assertionCreator: Expect<List<Long>>.() -> Unit): E
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.floatArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.floatArrAsListFeature
*/
@JvmName("floatArrAsList")
fun Expect<FloatArray>.asList(): Expect<List<Float>> =
Expand All @@ -250,7 +250,7 @@ fun Expect<FloatArray>.asList(): Expect<List<Float>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.floatArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.floatArrAsList
*/
@JvmName("floatArrAsList")
fun Expect<FloatArray>.asList(assertionCreator: Expect<List<Float>>.() -> Unit): Expect<FloatArray> =
Expand All @@ -267,7 +267,7 @@ fun Expect<FloatArray>.asList(assertionCreator: Expect<List<Float>>.() -> Unit):
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.doubleArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.doubleArrAsListFeature
*/
@JvmName("doubleArrAsList")
fun Expect<DoubleArray>.asList(): Expect<List<Double>> =
Expand All @@ -284,7 +284,7 @@ fun Expect<DoubleArray>.asList(): Expect<List<Double>> =
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.doubleArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.doubleArrAsList
*/
@JvmName("doubleArrAsList")
fun Expect<DoubleArray>.asList(assertionCreator: Expect<List<Double>>.() -> Unit): Expect<DoubleArray> =
Expand All @@ -301,7 +301,7 @@ fun Expect<DoubleArray>.asList(assertionCreator: Expect<List<Double>>.() -> Unit
*
* @since 0.9.0
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.booleanArrAsListFeature
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.booleanArrAsListFeature
*/
@JvmName("boolArrAsList")
fun Expect<BooleanArray>.asList(): Expect<List<Boolean>> =
Expand All @@ -317,7 +317,7 @@ fun Expect<BooleanArray>.asList(): Expect<List<Boolean>> =
* @return The newly created [Expect] for the transformed subject.
*
* @since 0.9.0
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayAssertionSamples.booleanArrAsList
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ArrayExpectationsSamples.booleanArrAsList
*/
@JvmName("boolArrAsList")
fun Expect<BooleanArray>.asList(assertionCreator: Expect<List<Boolean>>.() -> Unit): Expect<BooleanArray> =
Expand Down
Loading

0 comments on commit 57a3e5d

Please sign in to comment.