mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
write specs to cover custom bullet points, remove from other specs
This commit is contained in:
34
README.md
34
README.md
@@ -72,7 +72,7 @@ For instance, the [README of v0.15.0](https://github.com/robstoll/atrium/tree/v0
|
||||
- [Enhanced Reporting](#enhanced-reporting)
|
||||
- [Own Sophisticated Assertion Builders](#own-sophisticated-assertion-builders)
|
||||
- [Use own Assertion Verbs](#use-own-assertion-verbs)
|
||||
- [ReporterBuilder](#reporterbuilder)
|
||||
- [Use own Components](#use-own-components)
|
||||
- [Internationalization](#internationalization-1)
|
||||
- [API Styles](#api-styles)
|
||||
- [Java Interoperability](#java-interoperability)
|
||||
@@ -2296,7 +2296,7 @@ In order to create an own assertion verb it is sufficient to:
|
||||
3. Adjust package name and `import`s and rename `expect` as desired (you can also leave it that way of course).
|
||||
4. exclude `atrium-verbs` from your dependencies.
|
||||
Taking the setup shown in the [Installation](#installation) section for the JVM platform, you would replace the `dependencies` block as follows:
|
||||
```
|
||||
```gradle
|
||||
dependencies {
|
||||
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atrium_version") {
|
||||
exclude group: 'ch.tutteli.atrium', module: 'atrium-verbs'
|
||||
@@ -2326,17 +2326,20 @@ What are the drawbacks:
|
||||
- you have to maintain your assertion verbs. That should not be a big deal
|
||||
-- you might have to replace deprecated options by their replacement when you upgrade to a newer Atrium version but that's about it.
|
||||
|
||||
## Use own Components
|
||||
|
||||
## ReporterBuilder
|
||||
Replacing existing components with your own (or third-party) components can be done when specifying an own expection verb
|
||||
via `withOptions`. See for instance [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/master/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt#L31)
|
||||
which is used internally of Atrium in tests and uses a different `AtriumErrorAdjuster`.
|
||||
|
||||
The `ReporterBuilder` lets you choose among different options to configure the style of the reporting.
|
||||
For instance, in case you are not happy with the predefined bullet points, then you can change them via the `ReporterBuilder`.
|
||||
Have a look at [atriumVerbs.kt of atrium-api-infix-en_GB](https://github.com/robstoll/atrium/tree/master/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/testutils/AsciiBulletPointReporterFactory.kt)
|
||||
where you can find an example.
|
||||
Another example, say you prefer multi-line reporting over single-line reporting,
|
||||
then you can use `withOptions` as follows:
|
||||
```kotlin
|
||||
withOptions {
|
||||
withComponent(TextAssertionPairFormatter::class) { c -> TextNextLineAssertionPairFormatter(c.build(), c.build()) }
|
||||
}
|
||||
```
|
||||
|
||||
Or if you prefer multi-line reporting over single-line reporting,
|
||||
then you can configure `ReporterBuilder` as follows.
|
||||
Instead of using `.withTextSameLineAssertionPairFormatter()` you choose `withTextNextLineAssertionPairFormatter()`.
|
||||
The output looks then as follows:
|
||||
```kotlin
|
||||
expect(x).toBe(9)
|
||||
@@ -2357,14 +2360,9 @@ expect: 10 (kotlin.Int <934275857>)
|
||||
You prefer another reporting style but Atrium does not yet support it?
|
||||
Please let us know it by [writing a feature request](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]).
|
||||
|
||||
|
||||
There are more options to choose from.
|
||||
It does not matter if you use your [own assertion verb](#use-own-assertion-verbs) or a predefined one.
|
||||
You can provide your custom configured `Reporter` by providing a `ReporterFactory`.
|
||||
This is done via [ServiceLoader](https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html) -mechanism on JVM
|
||||
and by calling `registerService` on JS where the call has to be before your tests run.
|
||||
An example for JVM is given in [AsciiBulletPointReporterFactory](https://github.com/robstoll/atrium/blob/master/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs/testutils/AsciiBulletPointReporterFactory.kt).
|
||||
An example of how you can make sure your code is called earlier than the tests run is given in [testSetup.kt of atrium-core-robstoll-lib](https://github.com/robstoll/atrium/tree/master/core/robstoll-lib/atrium-core-robstoll-lib-js/src/test/kotlin/testSetup.kt).
|
||||
There are more options to choose from. Take a look at the
|
||||
[DefaultComponentFactoryContainer](https://github.com/robstoll/atrium/tree/master/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt#L121)
|
||||
to see the default configuration.
|
||||
|
||||
# Internationalization
|
||||
|
||||
|
||||
@@ -50,8 +50,7 @@ class AnyExpectationsSpec : ch.tutteli.atrium.specs.integration.AnyExpectationsS
|
||||
"notToBeNull" to Companion::notToBeNull,
|
||||
|
||||
getAndImmediatePair(),
|
||||
getAndLazyPair(),
|
||||
"◆ ", "⚬ ", "ℹ "
|
||||
getAndLazyPair()
|
||||
) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -11,8 +11,7 @@ class CharSequenceContainsAtLeastExpectationsSpec : Spek({
|
||||
getAtLeastBustAtMostIgnoringCaseValuesTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost,
|
||||
"◆ ", "⚬ "
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsAtLeastExpectationsSpec(
|
||||
@@ -22,8 +21,7 @@ class CharSequenceContainsAtLeastExpectationsSpec : Spek({
|
||||
getAtLeastButAtMostIgnoringCaseElementsOfTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost,
|
||||
"◆ ", "⚬ "
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<String>(
|
||||
|
||||
@@ -8,8 +8,7 @@ class CharSequenceContainsAtMostExpectationsSpec :
|
||||
getAtMostTriple(),
|
||||
getAtMostIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
"◆ ", "⚬ "
|
||||
getExactlyPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -10,14 +10,12 @@ class CharSequenceContainsContainsNotExpectationsSpec : Spek({
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsContainsNotExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNotPair(),
|
||||
"◆ ", "⚬ ", "▶ ",
|
||||
"[Atrium][Builder]"
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsContainsNotExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNotShortcutPair(),
|
||||
"◆ ", "⚬ ", "▶ ",
|
||||
"[Atrium][Shortcut]"
|
||||
) {})
|
||||
}) {
|
||||
|
||||
@@ -6,8 +6,7 @@ class CharSequenceContainsExactlyExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.CharSequenceContainsExactlyExpectationsSpec(
|
||||
getExactlyTriple(),
|
||||
getExactlyIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
"◆ ", "⚬ "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import ch.tutteli.atrium.creating.Expect
|
||||
|
||||
class CharSequenceContainsNotExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSequenceContainsNotExpectationsSpec(
|
||||
getContainsNotTriple(),
|
||||
getContainsNotIgnoringCaseTriple(),
|
||||
"◆ ", "⚬ "
|
||||
getContainsNotIgnoringCaseTriple()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -6,8 +6,7 @@ class CharSequenceContainsNotOrAtMostExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.CharSequenceContainsNotOrAtMostExpectationsSpec(
|
||||
getNotOrAtMostTriple(),
|
||||
getNotOrAtMostIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
"◆ ", "⚬ "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -25,7 +25,6 @@ class CharSequenceContainsRegexExpectationsSpec : Spek({
|
||||
getShortcutTripleString(),
|
||||
getAtMostTripleString(),
|
||||
getAtMostIgnoringCaseTripleString(),
|
||||
"◆ ", "⚬ ",
|
||||
"[StringSpec] "
|
||||
)
|
||||
|
||||
@@ -36,7 +35,6 @@ class CharSequenceContainsRegexExpectationsSpec : Spek({
|
||||
getShortcutTripleRegex(),
|
||||
getAtMostTripleRegex(),
|
||||
getAtMostIgnoringCaseTripleString(),
|
||||
"◆ ", "⚬ ",
|
||||
"[RegexSpec] "
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ class Fun0ExpectationsSpec : ch.tutteli.atrium.specs.integration.Fun0Expectation
|
||||
("toThrow" to Companion::toThrowFeature).withFeatureSuffix(),
|
||||
"toThrow" to Companion::toThrow,
|
||||
feature0<() -> Int, Int>(Expect<() -> Int>::notToThrow),
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow),
|
||||
"⚬ ", "» "
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow)
|
||||
) {
|
||||
companion object {
|
||||
private fun toThrowFeature(expect: Expect<out () -> Any?>) =
|
||||
|
||||
@@ -7,8 +7,7 @@ import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
|
||||
object IterableAllExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableAllExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::all),
|
||||
fun1(Expect<Iterable<Double?>>::all).withNullableSuffix(),
|
||||
"◆ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ "
|
||||
fun1(Expect<Iterable<Double?>>::all).withNullableSuffix()
|
||||
) {
|
||||
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@ class IterableAnyExpectationsSpec : Spek({
|
||||
object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::any),
|
||||
fun1(Expect<Iterable<Double?>>::any).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Predicate] "
|
||||
)
|
||||
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
functionDescription to C::containsEntry,
|
||||
(functionDescription to C::containsNullableEntry).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
@@ -34,7 +32,6 @@ class IterableAnyExpectationsSpec : Spek({
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
shortcutDescription to C::containsEntryShortcut,
|
||||
(shortcutDescription to C::containsNullableEntryShortcut).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
@@ -42,7 +39,6 @@ class IterableAnyExpectationsSpec : Spek({
|
||||
object SequenceSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
getContainsSequencePair(),
|
||||
getContainsNullableSequencePair().withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Sequence] "
|
||||
)
|
||||
|
||||
|
||||
@@ -15,14 +15,12 @@ class IterableContainsInAnyOrderAtLeast1ElementsOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
functionDescription to C::containsValues,
|
||||
(functionDescription to C::containsNullableValues).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
shortcutDescription to C::containsInAnyOrderShortcut,
|
||||
(shortcutDescription to C::containsInAnyOrderNullableShortcut).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,14 +14,12 @@ class IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec(
|
||||
functionDescription to C::containsInAnyOrderEntries,
|
||||
(functionDescription to C::containsNullableEntries).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec(
|
||||
fun2<Iterable<Double>, Expect<Double>.() -> Unit, Array<out Expect<Double>.() -> Unit>>(Expect<Iterable<Double>>::contains),
|
||||
fun2<Iterable<Double?>, (Expect<Double>.() -> Unit)?, Array<out (Expect<Double>.() -> Unit)?>>(Expect<Iterable<Double?>>::contains).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,14 +14,12 @@ class IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
functionDescription to C::containsValues,
|
||||
(functionDescription to C::containsNullableValues).withNullableSuffix(),
|
||||
"◆ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
fun2<Iterable<Double>, Double, Array<out Double>>(Expect<Iterable<Double>>::contains),
|
||||
fun2<Iterable<Double?>, Double?, Array<out Double?>>(Expect<Iterable<Double?>>::contains),
|
||||
"◆ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ class IterableContainsInAnyOrderAtLeastValuesExpectationsSpec :
|
||||
getAtLeastButAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
Companion::getErrorMsgAtLeastButAtMost,
|
||||
"◆ "
|
||||
Companion::getErrorMsgAtLeastButAtMost
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -7,8 +7,7 @@ class IterableContainsInAnyOrderAtMostValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtMostValuesExpectationsSpec(
|
||||
getAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
"◆ "
|
||||
getExactlyPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -6,8 +6,7 @@ import ch.tutteli.atrium.specs.notImplemented
|
||||
class IterableContainsInAnyOrderExactlyValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderExactlyValuesExpectationsSpec(
|
||||
getExactlyTriple(),
|
||||
getContainsNotPair(),
|
||||
"◆ "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -6,8 +6,7 @@ import ch.tutteli.atrium.specs.notImplemented
|
||||
class IterableContainsInAnyOrderNotOrAtMostValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderNotOrAtMostValuesExpectationsSpec(
|
||||
getNotOrAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
"◆ "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -11,9 +11,8 @@ class IterableContainsInAnyOrderOnlyElementsOfExpectationsSpec : Spek({
|
||||
include(BuilderIterableLikeToIterableSpec)
|
||||
}) {
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyValuesExpectationsSpec(
|
||||
functionDescription to C::containsElementsOf,
|
||||
(functionDescription to C::containsElementsOfNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» "
|
||||
functionDescription to C::containsElementsOf,
|
||||
(functionDescription to C::containsElementsOfNullable).withNullableSuffix()
|
||||
)
|
||||
|
||||
object BuilderIterableLikeToIterableSpec : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
|
||||
@@ -6,9 +6,8 @@ import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
|
||||
class IterableContainsInAnyOrderOnlyEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyEntriesExpectationsSpec(
|
||||
functionDescription to Companion::containsInAnyOrderOnlyEntries,
|
||||
(functionDescription to Companion::containsInAnyOrderOnlyNullableEntries).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» "
|
||||
functionDescription to Companion::containsInAnyOrderOnlyEntries,
|
||||
(functionDescription to Companion::containsInAnyOrderOnlyNullableEntries).withNullableSuffix()
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
val functionDescription = "$contains.$inAnyOrder.$only.$entry/$entries"
|
||||
|
||||
@@ -7,8 +7,7 @@ import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
class IterableContainsInAnyOrderOnlyValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyValuesExpectationsSpec(
|
||||
functionDescription to Companion::containsInAnyOrderOnlyValues,
|
||||
(functionDescription to Companion::containsInAnyOrderOnlyNullableValues).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ "
|
||||
(functionDescription to Companion::containsInAnyOrderOnlyNullableValues).withNullableSuffix()
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
val functionDescription = "$contains.$inAnyOrder.$only.$value/$values"
|
||||
|
||||
@@ -15,14 +15,12 @@ class IterableContainsInOrderOnlyElementsOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
functionDescription to C::containsInOrderOnlyValues,
|
||||
(functionDescription to C::containsInOrderOnlyNullableValues).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
shortcutDescription to C::containsExactlyElementsOfShortcut,
|
||||
(shortcutDescription to C::containsExactlyElementsOfNullableShortcut).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -16,14 +16,12 @@ class IterableContainsInOrderOnlyEntriesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyEntriesExpectationsSpec(
|
||||
functionDescription to C::containsInOrderOnly,
|
||||
(functionDescription to C::containsInOrderOnlyNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyEntriesExpectationsSpec(
|
||||
fun2<Iterable<Double>, Expect<Double>.() -> Unit, Array<out Expect<Double>.() -> Unit>>(Expect<Iterable<Double>>::containsExactly),
|
||||
fun2<Iterable<Double?>, (Expect<Double>.() -> Unit)?, Array<out (Expect<Double>.() -> Unit)?>>(Expect<Iterable<Double?>>::containsExactly).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -6,9 +6,8 @@ import ch.tutteli.atrium.specs.notImplemented
|
||||
|
||||
class IterableContainsInOrderOnlyGroupedEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyGroupedEntriesExpectationsSpec(
|
||||
functionDescription to Companion::containsInOrderOnlyGroupedInAnyOrderEntries,
|
||||
functionDescription to Companion::containsInOrderOnlyGroupedInAnyOrderEntries,
|
||||
Companion::groupFactory,
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -11,7 +11,6 @@ class IterableContainsInOrderOnlyGroupedValuesExpectationsSpec :
|
||||
Companion::groupFactory,
|
||||
(functionDescription to Companion::containsInOrderOnlyGroupedInAnyOrderNullableValues).withNullableSuffix(),
|
||||
Companion::nullableGroupFactory,
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -16,14 +16,12 @@ class IterableContainsInOrderOnlyValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
functionDescription to C::containsInOrderOnlyValues,
|
||||
(functionDescription to C::containsInOrderOnlyNullableValues).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
fun2<Iterable<Double>, Double, Array<out Double>>(Expect<Iterable<Double>>::containsExactly),
|
||||
fun2<Iterable<Double?>, Double?, Array<out Double?>>(Expect<Iterable<Double?>>::containsExactly).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ class IterableContainsNotEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsNotEntriesExpectationsSpec(
|
||||
functionDescription to Companion::containsNotFun,
|
||||
(functionDescription to Companion::containsNotNullableFun).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -17,14 +17,12 @@ class IterableContainsNotValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsNotValuesExpectationsSpec(
|
||||
functionDescription to C::containsNotFun,
|
||||
(functionDescription to C::containsNotNullableFun).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "⚬ ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsNotValuesExpectationsSpec(
|
||||
fun2<Iterable<Double>,Double, Array<out Double>>(Expect<Iterable<Double>>::containsNot),
|
||||
fun2<Iterable<Double?>,Double?, Array<out Double?>>(Expect<Iterable<Double?>>::containsNot).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "⚬ ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ class IterableNoneExpectationsSpec : Spek({
|
||||
object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableNoneExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::none),
|
||||
fun1(Expect<Iterable<Double?>>::none).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Predicate] "
|
||||
)
|
||||
|
||||
@@ -23,7 +22,6 @@ class IterableNoneExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableNoneExpectationsSpec(
|
||||
functionDescription to C::containsNotFun,
|
||||
(functionDescription to C::containsNotNullableFun).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@ class MapContainsInAnyOrderOnlyEntriesOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
functionDescription to C::containsKeyValuePairs,
|
||||
(functionDescription to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
mfun2<String, Int, Int>(C::containsInAnyOrderOnlyEntriesOf),
|
||||
mfun2<String?, Int?, Int?>(C::containsInAnyOrderOnlyEntriesOf).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ class MapContainsInAnyOrderOnlyKeyValueExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValueExpectationsSpec(
|
||||
functionDescription to C::containsKeyValues,
|
||||
(functionDescription to C::containsKeyValuesNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
@@ -24,7 +23,6 @@ class MapContainsInAnyOrderOnlyKeyValueExpectationsSpec : Spek({
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValueExpectationsSpec(
|
||||
mfun2<String, Int, Expect<Int>.() -> Unit>(C::containsOnly),
|
||||
mfun2<String?, Int?, (Expect<Int>.() -> Unit)?>(C::containsOnly).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,14 +14,12 @@ class MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
functionDescription to C::containsKeyValuePairs,
|
||||
(functionDescription to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
mfun2<String, Int, Int>(Expect<Map<out String, Int>>::containsOnly),
|
||||
mfun2<String?, Int?, Int?>(Expect<Map<out String?, Int?>>::containsOnly).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ class MapContainsInOrderOnlyEntriesOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
functionDescription to C::containsKeyValuePairs,
|
||||
(functionDescription to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ class MapContainsInOrderOnlyKeyValueExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValueExpectationsSpec(
|
||||
functionDescription to C::containsKeyValues,
|
||||
(functionDescription to C::containsKeyValuesNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ class MapContainsInOrderOnlyKeyValuePairsExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
functionDescription to C::containsKeyValuePairs,
|
||||
(functionDescription to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"◆ ", "✔ ", "✘ ", "❗❗ ", "⚬ ", "» ", "▶ ", "◾ ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ class Fun0ExpectationsJvmSpec : ch.tutteli.atrium.specs.integration.Fun0Expectat
|
||||
("toThrow" to Companion::toThrowFeature).withFeatureSuffix(),
|
||||
"toThrow" to Companion::toThrow,
|
||||
feature0<() -> Int, Int>(Expect<() -> Int>::notToThrow),
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow),
|
||||
"⚬ ", "» "
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow)
|
||||
) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.fun2
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withFeatureSuffix
|
||||
import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
import kotlin.reflect.KFunction2
|
||||
@@ -50,11 +49,10 @@ class AnyExpectationsSpec : ch.tutteli.atrium.specs.integration.AnyExpectationsS
|
||||
"notToBeNull" to Companion::notToBeNull,
|
||||
|
||||
getAndImmediatePair(),
|
||||
getAndLazyPair(),
|
||||
"* ", "- ", "(i) "
|
||||
getAndLazyPair()
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private fun toBeNull(expect: Expect<Int?>) = expect toBe null
|
||||
|
||||
@Suppress("RemoveExplicitTypeArguments")
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class ArrayAsListExpectationsSpec : ch.tutteli.atrium.specs.integration.ArrayAsListExpectationsSpec(
|
||||
"asList",
|
||||
@@ -27,7 +26,7 @@ class ArrayAsListExpectationsSpec : ch.tutteli.atrium.specs.integration.ArrayAsL
|
||||
Companion::booleanArrayWithCreator
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
fun arrayInt(expect: Expect<Array<Int>>) = expect asList o
|
||||
fun byteArray(expect: Expect<ByteArray>) = expect asList o
|
||||
fun charArray(expect: Expect<CharArray>) = expect asList o
|
||||
|
||||
@@ -11,8 +11,7 @@ class CharSequenceContainsAtLeastExpectationsSpec : Spek({
|
||||
getAtLeastBustAtMostIgnoringCaseValuesTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost,
|
||||
"* ", "- "
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsAtLeastExpectationsSpec(
|
||||
@@ -22,8 +21,7 @@ class CharSequenceContainsAtLeastExpectationsSpec : Spek({
|
||||
getAtLeastButAtMostIgnoringCaseElementsOfTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost,
|
||||
"* ", "- "
|
||||
CharSequenceContainsAtLeastExpectationsSpec.Companion::getErrorMsgAtLeastButAtMost
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<String>(
|
||||
|
||||
@@ -8,8 +8,7 @@ class CharSequenceContainsAtMostExpectationsSpec :
|
||||
getAtMostTriple(),
|
||||
getAtMostIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
"* ", "- "
|
||||
getExactlyPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -10,14 +10,12 @@ class CharSequenceContainsContainsNotExpectationsSpec : Spek({
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsContainsNotExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNotPair(),
|
||||
"* ", "- ", ">> ",
|
||||
"[Atrium][Builder]"
|
||||
) {})
|
||||
|
||||
include(object : ch.tutteli.atrium.specs.integration.CharSequenceContainsContainsNotExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNotShortcutPair(),
|
||||
"* ", "- ", ">> ",
|
||||
"[Atrium][Shortcut]"
|
||||
) {})
|
||||
}) {
|
||||
|
||||
@@ -6,8 +6,7 @@ class CharSequenceContainsExactlyExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.CharSequenceContainsExactlyExpectationsSpec(
|
||||
getExactlyTriple(),
|
||||
getExactlyIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
"* ", "- "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -4,8 +4,7 @@ import ch.tutteli.atrium.creating.Expect
|
||||
|
||||
class CharSequenceContainsNotExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSequenceContainsNotExpectationsSpec(
|
||||
getContainsNotTriple(),
|
||||
getContainsNotIgnoringCaseTriple(),
|
||||
"* ", "- "
|
||||
getContainsNotIgnoringCaseTriple()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -6,8 +6,7 @@ class CharSequenceContainsNotOrAtMostExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.CharSequenceContainsNotOrAtMostExpectationsSpec(
|
||||
getNotOrAtMostTriple(),
|
||||
getNotOrAtMostIgnoringCaseTriple(),
|
||||
getContainsNotPair(),
|
||||
"* ", "- "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : CharSequenceContainsSpecBase() {
|
||||
|
||||
@@ -26,7 +26,6 @@ class CharSequenceContainsRegexExpectationsSpec : Spek({
|
||||
getShortcutTripleString(),
|
||||
getAtMostTripleString(),
|
||||
getAtMostIgnoringCaseTripleString(),
|
||||
"* ", "- ",
|
||||
"[StringSpec] "
|
||||
)
|
||||
|
||||
@@ -37,7 +36,6 @@ class CharSequenceContainsRegexExpectationsSpec : Spek({
|
||||
getShortcutTripleRegex(),
|
||||
getAtMostTripleRegex(),
|
||||
getAtMostIgnoringCaseTripleString(),
|
||||
"* ", "- ",
|
||||
"[RegexSpec] "
|
||||
)
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ import ch.tutteli.atrium.logic.creating.charsequence.contains.steps.NotCheckerSt
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.name
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.reflect.KFunction2
|
||||
|
||||
abstract class CharSequenceContainsSpecBase : WithAsciiReporter() {
|
||||
abstract class CharSequenceContainsSpecBase {
|
||||
private val containsProp: KFunction2<Expect<String>, o, CharSequenceContains.EntryPointStep<String, NoOpSearchBehaviour>> =
|
||||
Expect<String>::contains
|
||||
protected val contains = containsProp.name
|
||||
|
||||
@@ -3,7 +3,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class CharSequenceExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSequenceExpectationsSpec(
|
||||
"toBe ${empty::class.simpleName}" to Companion::toBeEmpty,
|
||||
@@ -20,7 +19,7 @@ class CharSequenceExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSeq
|
||||
fun1<CharSequence, Regex>(Expect<CharSequence>::matches),
|
||||
fun1<CharSequence, Regex>(Expect<CharSequence>::mismatches)
|
||||
) {
|
||||
companion object : WithAsciiReporter(){
|
||||
companion object {
|
||||
private fun toBeEmpty(expect: Expect<CharSequence>) = expect toBe empty
|
||||
private fun notToBeEmpty(expect: Expect<CharSequence>) = expect notToBe empty
|
||||
private fun notToBeBlank(expect: Expect<CharSequence>) = expect notToBe blank
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.*
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class CollectionExpectationsSpec : ch.tutteli.atrium.specs.integration.CollectionExpectationsSpec(
|
||||
"toBe ${empty::class.simpleName}" to Companion::isEmpty,
|
||||
@@ -10,7 +9,7 @@ class CollectionExpectationsSpec : ch.tutteli.atrium.specs.integration.Collectio
|
||||
property<Collection<Int>, Int>(Expect<Collection<Int>>::size),
|
||||
fun1<Collection<Int>, Expect<Int>.() -> Unit>(Expect<Collection<Int>>::size)
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private fun isEmpty(expect: Expect<Collection<Int>>) = expect toBe empty
|
||||
private fun isNotEmpty(expect: Expect<Collection<Int>>) = expect notToBe empty
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.integration.DiffEqualsCompareTo
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class ComparableExpectationsSpec : ch.tutteli.atrium.specs.integration.ComparableExpectationsSpec(
|
||||
fun1(Expect<Int>::isLessThan),
|
||||
@@ -15,8 +14,6 @@ class ComparableExpectationsSpec : ch.tutteli.atrium.specs.integration.Comparabl
|
||||
fun1(Expect<DiffEqualsCompareTo>::isEqualComparingTo)
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused")
|
||||
fun ambiguityTest() {
|
||||
val a1: Expect<Int> = notImplemented()
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.api.infix.en_GB.workaround.it
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.integration.TestData
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class FeatureExpectationsBoundedReferenceAlternativeSpec : ch.tutteli.atrium.specs.integration.FeatureExpectationsSpec(
|
||||
propertyImmediate,
|
||||
@@ -53,7 +52,7 @@ class FeatureExpectationsBoundedReferenceAlternativeSpec : ch.tutteli.atrium.spe
|
||||
) {
|
||||
|
||||
//TODO remove type parameters for `of` with Kotiln 1.4 including parentheses (make the calls infix again
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
//@formatter:off
|
||||
val propertyImmediate: F = { it feature { p(it::nonNullValue) } contains "hello" }
|
||||
val propertyLazy: F = { it feature of<TestData, String>({ p(it::nonNullValue) }) { it contains "hello" } }
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.api.infix.en_GB.workaround.it
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.integration.TestData
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
internal typealias F = Expect<TestData>.() -> Unit
|
||||
|
||||
@@ -55,7 +54,7 @@ class FeatureExpectationsBoundedReferenceSpec : ch.tutteli.atrium.specs.integrat
|
||||
) {
|
||||
|
||||
//TODO remove type parameters for `of` with Kotiln 1.4 including parentheses (make the calls infix again
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
//@formatter:off
|
||||
val propertyImmediate: F = { it feature { f(it::nonNullValue) } contains "hello" }
|
||||
val propertyLazy: F = { it feature of<TestData, String>({ f(it::nonNullValue) }) { it contains "hello" } }
|
||||
|
||||
@@ -3,7 +3,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.integration.TestData
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class FeatureExpectationsClassReferenceSpec : ch.tutteli.atrium.specs.integration.FeatureExpectationsSpec(
|
||||
propertyImmediate,
|
||||
@@ -52,7 +51,7 @@ class FeatureExpectationsClassReferenceSpec : ch.tutteli.atrium.specs.integratio
|
||||
) {
|
||||
|
||||
//TODO remove type parameters for `of` with Kotiln 1.4 including parentheses (make the calls infix again
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
//@formatter:off
|
||||
val propertyImmediate: F = { it feature TestData::nonNullValue contains "hello" }
|
||||
val propertyLazy: F = { it feature of(TestData::nonNullValue) { it contains "hello" } }
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.api.infix.en_GB.workaround.it
|
||||
import ch.tutteli.atrium.specs.integration.TestData
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
|
||||
class FeatureExpectationsManualSpec : ch.tutteli.atrium.specs.integration.FeatureExpectationsSpec(
|
||||
@@ -51,7 +50,7 @@ class FeatureExpectationsManualSpec : ch.tutteli.atrium.specs.integration.Featur
|
||||
isAbleToEvaluateDescription = false
|
||||
) {
|
||||
//TODO remove type parameters for `of` with Kotiln 1.4 including parentheses (make the calls infix again
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
//@formatter:off
|
||||
val propertyImmediate: F = { it feature { f("nonNullValue", it.nonNullValue) } contains "hello" }
|
||||
|
||||
|
||||
@@ -4,17 +4,15 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.feature0
|
||||
import ch.tutteli.atrium.specs.feature1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withFeatureSuffix
|
||||
|
||||
class Fun0ExpectationsSpec : ch.tutteli.atrium.specs.integration.Fun0ExpectationsSpec(
|
||||
("toThrow" to Companion::toThrowFeature).withFeatureSuffix(),
|
||||
"toThrow" to Companion::toThrow,
|
||||
feature0<() -> Int, Int>(Expect<() -> Int>::notToThrow),
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow),
|
||||
"- ", "» "
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow)
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private fun toThrowFeature(expect: Expect<out () -> Any?>) =
|
||||
expect.toThrow<IllegalArgumentException>()
|
||||
|
||||
|
||||
@@ -3,15 +3,12 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
|
||||
class IterableAllExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableAllExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::all),
|
||||
fun1(Expect<Iterable<Double?>>::all).withNullableSuffix(),
|
||||
"* ", "(!) ", "- ", "» ", ">> ", "=> "
|
||||
fun1(Expect<Iterable<Double?>>::all).withNullableSuffix()
|
||||
) {
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -18,28 +18,24 @@ class IterableAnyExpectationsSpec : Spek({
|
||||
object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::any),
|
||||
fun1(Expect<Iterable<Double?>>::any).withNullableSuffix(),
|
||||
"* ",
|
||||
"[Atrium][Predicate] "
|
||||
)
|
||||
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair().withNullableSuffix(),
|
||||
"* ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair().withNullableSuffix(),
|
||||
"* ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
object SequenceSpec : ch.tutteli.atrium.specs.integration.IterableAnyExpectationsSpec(
|
||||
getContainsSequencePair(),
|
||||
getContainsNullableSequencePair().withNullableSuffix(),
|
||||
"* ",
|
||||
"[Atrium][Sequence] "
|
||||
)
|
||||
|
||||
|
||||
@@ -13,14 +13,12 @@ class IterableContainsInAnyOrderAtLeast1ElementsOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -11,14 +11,12 @@ class IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1EntriesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -11,14 +11,12 @@ class IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtLeast1ValuesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ class IterableContainsInAnyOrderAtLeastValuesExpectationsSpec :
|
||||
getAtLeastButAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
Companion::getErrorMsgAtLeastButAtMost,
|
||||
"* "
|
||||
Companion::getErrorMsgAtLeastButAtMost
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -6,8 +6,7 @@ class IterableContainsInAnyOrderAtMostValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderAtMostValuesExpectationsSpec(
|
||||
getAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
getExactlyPair(),
|
||||
"* "
|
||||
getExactlyPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -5,8 +5,7 @@ import ch.tutteli.atrium.creating.Expect
|
||||
class IterableContainsInAnyOrderExactlyValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderExactlyValuesExpectationsSpec(
|
||||
getExactlyTriple(),
|
||||
getContainsNotPair(),
|
||||
"* "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -5,8 +5,7 @@ import ch.tutteli.atrium.creating.Expect
|
||||
class IterableContainsInAnyOrderNotOrAtMostValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderNotOrAtMostValuesExpectationsSpec(
|
||||
getNotOrAtMostTriple(),
|
||||
getContainsNotPair(),
|
||||
"* "
|
||||
getContainsNotPair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -9,15 +9,15 @@ class IterableContainsInAnyOrderOnlyElementsOfExpectationsSpec : Spek({
|
||||
}) {
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» "
|
||||
getContainsNullablePair()
|
||||
)
|
||||
|
||||
object BuilderIterableLikeToIterableSpec : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"contains o inAny order but only elementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it contains o inAny order but only elementsOf input }
|
||||
)
|
||||
object BuilderIterableLikeToIterableSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"contains o inAny order but only elementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it contains o inAny order but only elementsOf input }
|
||||
)
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
fun getContainsPair() =
|
||||
|
||||
@@ -5,9 +5,9 @@ import ch.tutteli.atrium.creating.Expect
|
||||
class IterableContainsInAnyOrderOnlyEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyEntriesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» "
|
||||
getContainsNullablePair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
fun getContainsPair() =
|
||||
"$contains $filler $inAnyOrder $butOnly $inAnyOrderOnlyEntries" to Companion::containsInAnyOrderOnlyEntries
|
||||
|
||||
@@ -5,9 +5,9 @@ import ch.tutteli.atrium.creating.Expect
|
||||
class IterableContainsInAnyOrderOnlyValuesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInAnyOrderOnlyValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- "
|
||||
getContainsNullablePair()
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
fun getContainsPair() =
|
||||
"$contains $filler $inAnyOrder $butOnly $inAnyOrderOnlyValues" to Companion::containsInAnyOrderOnlyValues
|
||||
|
||||
@@ -13,28 +13,28 @@ class IterableContainsInOrderOnlyElementsOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
object BuilderIterableLikeToIterableSpec : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"contains o inGiven order and only elementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it contains o inGiven order and only elementsOf input }
|
||||
)
|
||||
object BuilderIterableLikeToIterableSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"contains o inGiven order and only elementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it contains o inGiven order and only elementsOf input }
|
||||
)
|
||||
|
||||
object ShortcutIterableLikeToIterableSpec : ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"containsExactlyElementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it containsExactlyElementsOf input }
|
||||
)
|
||||
object ShortcutIterableLikeToIterableSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableLikeToIterableSpec<List<Int>>(
|
||||
"containsExactlyElementsOf",
|
||||
listOf(1, 2),
|
||||
{ input -> it containsExactlyElementsOf input }
|
||||
)
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
fun getContainsPair() =
|
||||
|
||||
@@ -13,14 +13,12 @@ class IterableContainsInOrderOnlyEntriesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyEntriesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyEntriesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ class IterableContainsInOrderOnlyGroupedEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyGroupedEntriesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
Companion::groupFactory,
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -9,7 +9,6 @@ class IterableContainsInOrderOnlyGroupedValuesExpectationsSpec :
|
||||
Companion::groupFactory,
|
||||
getContainsNullablePair(),
|
||||
Companion::nullableGroupFactory,
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
@@ -13,14 +13,12 @@ class IterableContainsInOrderOnlyValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
getContainsPair(),
|
||||
getContainsNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesExpectationsSpec(
|
||||
getContainsShortcutPair(),
|
||||
getContainsNullableShortcutPair(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ class IterableContainsNotEntriesExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.IterableContainsNotEntriesExpectationsSpec(
|
||||
getContainsNotPair(),
|
||||
getContainsNotNullablePair().withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
) {
|
||||
|
||||
companion object : IterableContainsSpecBase() {
|
||||
|
||||
private fun getContainsNotPair() = containsNot to Companion::containsNotFun
|
||||
|
||||
@@ -14,14 +14,12 @@ class IterableContainsNotValuesExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsNotValuesExpectationsSpec(
|
||||
getContainsNotPair(),
|
||||
getContainsNotNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "- ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.IterableContainsNotValuesExpectationsSpec(
|
||||
getContainsNotShortcutPair(),
|
||||
getContainsNotNullablePair(),
|
||||
"* ", "(/) ", "(x) ", "- ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.*
|
||||
import ch.tutteli.atrium.logic.creating.iterable.contains.steps.AtLeastCheckerStep
|
||||
import ch.tutteli.atrium.logic.creating.iterable.contains.steps.NotCheckerStep
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.reflect.KFunction2
|
||||
|
||||
abstract class IterableContainsSpecBase : WithAsciiReporter() {
|
||||
abstract class IterableContainsSpecBase {
|
||||
private val Values = "values"
|
||||
private val Entries = "entries"
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.*
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.reflect.KFunction2
|
||||
|
||||
class IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableExpectationsSpec(
|
||||
@@ -14,7 +13,7 @@ class IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableExp
|
||||
fun1<Iterable<Int>, Expect<Int>.() -> Unit>(Expect<Iterable<Int>>::max),
|
||||
getContainsNoDuplicatesPair()
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private val has: KFunction2<Expect<Iterable<Int>>, next, Expect<Iterable<Int>>> = Expect<Iterable<Int>>::has
|
||||
private fun getHasNextPair() = "${has.name} ${next::class.simpleName}" to Companion::hasNext
|
||||
private fun hasNext(expect: Expect<Iterable<Int>>) = expect has next
|
||||
@@ -33,8 +32,10 @@ class IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableExp
|
||||
|
||||
private val containsDuplicates: KFunction2<Expect<Iterable<Int>>, noDuplicates, Expect<Iterable<Int>>> =
|
||||
Expect<Iterable<Int>>::contains
|
||||
|
||||
private fun getContainsNoDuplicatesPair() =
|
||||
"${containsDuplicates.name} ${noDuplicates::class.simpleName}" to Companion::containsNoDuplicates
|
||||
|
||||
private fun containsNoDuplicates(expect: Expect<Iterable<Int>>) = expect contains noDuplicates
|
||||
|
||||
}
|
||||
|
||||
@@ -15,14 +15,12 @@ class IterableNoneExpectationsSpec : Spek({
|
||||
object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableNoneExpectationsSpec(
|
||||
fun1(Expect<Iterable<Double>>::none),
|
||||
fun1(Expect<Iterable<Double?>>::none).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Predicate] "
|
||||
)
|
||||
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableNoneExpectationsSpec(
|
||||
getContainsNotPair(),
|
||||
getContainsNotNullablePair().withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -2,14 +2,13 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.reflect.KFunction2
|
||||
|
||||
class IteratorExpectationsSpec : ch.tutteli.atrium.specs.integration.IteratorExpectationsSpec(
|
||||
getHasNextPair(),
|
||||
getHasNotNextPair()
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private val has: KFunction2<Expect<Iterator<Int>>, next, Expect<Iterator<Int>>> = Expect<Iterator<Int>>::has
|
||||
private fun getHasNextPair() = "${has.name} ${next::class.simpleName}" to Companion::hasNext
|
||||
private fun hasNext(expect: Expect<Iterator<Int>>) = expect has next
|
||||
|
||||
@@ -5,7 +5,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.feature1
|
||||
import ch.tutteli.atrium.specs.fun2
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
import org.spekframework.spek2.Spek
|
||||
import org.spekframework.spek2.style.specification.describe
|
||||
@@ -60,7 +59,7 @@ class ListExpectationsSpec : Spek({
|
||||
}
|
||||
})
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
|
||||
private fun get(expect: Expect<List<Int>>, index: Int, assertionCreator: Expect<Int>.() -> Unit) =
|
||||
expect get index(index) { assertionCreator() }
|
||||
|
||||
@@ -5,14 +5,13 @@ import ch.tutteli.atrium.specs.feature1
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.name
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class MapAsEntriesExpectationsSpec : ch.tutteli.atrium.specs.integration.MapAsEntriesExpectationsSpec(
|
||||
asEntriesPair(),
|
||||
fun1<Map<String, Int>, Expect<Set<Map.Entry<String, Int>>>.() -> Unit>(Expect<Map<String, Int>>::asEntries)
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
fun asEntriesPair() =
|
||||
feature1<Map<String, Int>, o, Set<Map.Entry<String, Int>>>(Expect<Map<String, Int>>::asEntries).name to ::asEntriesFeature
|
||||
|
||||
|
||||
@@ -18,15 +18,12 @@ class MapContainsInAnyOrderOnlyEntriesOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
containsKeyValuePair_s to C::containsKeyValuePairs,
|
||||
(containsKeyValuePair_s to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
mfun2<String, Int, Int>(C::containsOnlyEntriesOf),
|
||||
mfun2<String?, Int?, Int?>(C::containsOnlyEntriesOf).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
mfun2<String?, Int?, Int?>(C::containsOnlyEntriesOf).withNullableSuffix()
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -16,14 +16,12 @@ class MapContainsInAnyOrderOnlyKeyValueExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValueExpectationsSpec(
|
||||
containsKeyValue_s to C::containsKeyValues,
|
||||
(containsKeyValue_s to C::containsKeyValuesNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValueExpectationsSpec(
|
||||
mfun2<String, Int, Expect<Int>.() -> Unit>(C::containsOnly),
|
||||
mfun2<String?, Int?, (Expect<Int>.() -> Unit)?>(C::containsOnly).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -15,14 +15,12 @@ class MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
containsKeyValuePair_s to C::containsKeyValuePairs,
|
||||
(containsKeyValuePair_s to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
object ShortcutSpec : ch.tutteli.atrium.specs.integration.MapContainsInAnyOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
mfun2<String, Int, Int>(C::containsInAnyOrderOnly),
|
||||
mfun2<String?, Int?, Int?>(C::containsInAnyOrderOnly).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Shortcut] "
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ class MapContainsInOrderOnlyEntriesOfExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
containsKeyValuePair_s to C::containsKeyValuePairs,
|
||||
(containsKeyValuePair_s to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ class MapContainsInOrderOnlyKeyValueExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValueExpectationsSpec(
|
||||
containsKeyValue_s to C::containsKeyValues,
|
||||
(containsKeyValue_s to C::containsKeyValuesNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ class MapContainsInOrderOnlyKeyValuePairsExpectationsSpec : Spek({
|
||||
object BuilderSpec : ch.tutteli.atrium.specs.integration.MapContainsInOrderOnlyKeyValuePairsExpectationsSpec(
|
||||
containsKeyValuePair_s to C::containsKeyValuePairs,
|
||||
(containsKeyValuePair_s to C::containsKeyValuePairsNullable).withNullableSuffix(),
|
||||
"* ", "(/) ", "(x) ", "(!) ", "- ", "» ", ">> ", "=> ",
|
||||
"[Atrium][Builder] "
|
||||
)
|
||||
|
||||
|
||||
@@ -8,10 +8,9 @@ import ch.tutteli.atrium.logic.creating.maplike.contains.MapLikeContains
|
||||
import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InAnyOrderSearchBehaviour
|
||||
import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InOrderSearchBehaviour
|
||||
import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.NoOpSearchBehaviour
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.reflect.KFunction2
|
||||
|
||||
abstract class MapContainsSpecBase : WithAsciiReporter() {
|
||||
abstract class MapContainsSpecBase {
|
||||
private val containsProp: KFunction2<Expect<Map<*, *>>, o, *> = Expect<Map<*, *>>::contains
|
||||
protected val contains = containsProp.name
|
||||
protected val filler = o::class.simpleName
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.*
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class MapEntryExpectationsSpec : ch.tutteli.atrium.specs.integration.MapEntryExpectationsSpec(
|
||||
fun1(Expect<Map.Entry<String, Int>>::isKeyValue).name to Companion::isKeyValue,
|
||||
@@ -16,7 +15,7 @@ class MapEntryExpectationsSpec : ch.tutteli.atrium.specs.integration.MapEntryExp
|
||||
property<Map.Entry<String?, Int?>, Int?>(Expect<Map.Entry<String?, Int?>>::value),
|
||||
fun1<Map.Entry<String?, Int?>, Expect<Int?>.() -> Unit>(Expect<Map.Entry<String?, Int?>>::value)
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
|
||||
private fun isKeyValue(expect: Expect<Map.Entry<String, Int>>, key: String, value: Int) =
|
||||
expect isKeyValue (key to value)
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.*
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
class MapExpectationsSpec : ch.tutteli.atrium.specs.integration.MapExpectationsSpec(
|
||||
@@ -21,7 +20,7 @@ class MapExpectationsSpec : ch.tutteli.atrium.specs.integration.MapExpectationsS
|
||||
property<Map<out String, Int>, Collection<Int>>(Expect<Map<out String, Int>>::values),
|
||||
fun1<Map<out String, Int>, Expect<Collection<Int>>.() -> Unit>(Expect<Map<out String, Int>>::values)
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
private fun containsKey(expect: Expect<Map<out String, *>>, key: String) =
|
||||
expect containsKey key
|
||||
|
||||
@@ -147,5 +146,5 @@ class MapExpectationsSpec : ch.tutteli.atrium.specs.integration.MapExpectationsS
|
||||
nullableKeyValueMap = nullableKeyValueMap getExisting key(1) { }
|
||||
readOnlyNullableKeyValueMap = readOnlyNullableKeyValueMap getExisting key(1f) { }
|
||||
starMap = starMap getExisting key(1) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.property
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class PairExpectationsSpec : ch.tutteli.atrium.specs.integration.PairExpectationsSpec(
|
||||
property<Pair<String, Int>, String>(Expect<Pair<String, Int>>::first),
|
||||
@@ -16,7 +15,6 @@ class PairExpectationsSpec : ch.tutteli.atrium.specs.integration.PairExpectation
|
||||
property<Pair<String?, Int?>, Int?>(Expect<Pair<String?, Int?>>::second),
|
||||
fun1<Pair<String?, Int?>, Expect<Int?>.() -> Unit>(Expect<Pair<String?, Int?>>::second)
|
||||
) {
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -2,7 +2,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.*
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
|
||||
class ThrowableExpectationsSpec : ch.tutteli.atrium.specs.integration.ThrowableExpectationsSpec(
|
||||
property<Throwable, String>(Expect<Throwable>::message),
|
||||
@@ -12,7 +11,7 @@ class ThrowableExpectationsSpec : ch.tutteli.atrium.specs.integration.ThrowableE
|
||||
"cause" to Companion::cause
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
|
||||
private fun messageContains(
|
||||
expect: Expect<Throwable>,
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.api.verbs.internal.expect
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.integration.BigDecimalExpectationsSpec
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withNullableSuffix
|
||||
import org.spekframework.spek2.Spek
|
||||
import org.spekframework.spek2.style.specification.describe
|
||||
@@ -30,7 +29,8 @@ class BigDecimalAssertionsSpec : Spek({
|
||||
}
|
||||
}
|
||||
}) {
|
||||
companion object : WithAsciiReporter() {
|
||||
|
||||
companion object {
|
||||
@Suppress("DEPRECATION")
|
||||
fun toBeBigDecimal(expect: Expect<BigDecimal>, a: BigDecimal): Nothing = expect toBe a
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import org.spekframework.spek2.Spek
|
||||
import java.time.LocalDate
|
||||
import java.time.chrono.ChronoLocalDate
|
||||
@@ -29,8 +28,6 @@ class ChronoLocalDateExpectationsSpec : Spek({
|
||||
fun1<ChronoLocalDate, String>(Expect<ChronoLocalDate>::isEqual)
|
||||
)
|
||||
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
val chronoLocalDate: ChronoLocalDate = notImplemented()
|
||||
|
||||
@@ -3,7 +3,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import org.spekframework.spek2.Spek
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
@@ -31,8 +30,6 @@ class ChronoLocalDateTimeExpectationsSpec : Spek({
|
||||
fun1<ChronoLocalDateTime<*>, String>(Expect<ChronoLocalDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
val chronoLocalDateTime: ChronoLocalDateTime<*> = notImplemented()
|
||||
|
||||
@@ -3,7 +3,6 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import org.spekframework.spek2.Spek
|
||||
import java.time.LocalDate
|
||||
import java.time.ZonedDateTime
|
||||
@@ -14,23 +13,23 @@ class ChronoZonedDateTimeExpectationsSpec : Spek({
|
||||
include(ChronoZonedDateTimeExpectationsSpec)
|
||||
include(ChronoZonedDateTimeAsStringExpectationsSpec)
|
||||
}) {
|
||||
object ChronoZonedDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeExpectationsSpec(
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isBefore),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isBeforeOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isAfter),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isAfterOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isEqual)
|
||||
)
|
||||
object ChronoZonedDateTimeExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeExpectationsSpec(
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isBefore),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isBeforeOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isAfter),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isAfterOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, ChronoZonedDateTime<*>>(Expect<ChronoZonedDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
object ChronoZonedDateTimeAsStringExpectationsSpec : ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeAsStringExpectationsSpec(
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isBefore),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isBeforeOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isAfter),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isAfterOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
companion object : WithAsciiReporter()
|
||||
object ChronoZonedDateTimeAsStringExpectationsSpec :
|
||||
ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeAsStringExpectationsSpec(
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isBefore),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isBeforeOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isAfter),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isAfterOrEqual),
|
||||
fun1<ChronoZonedDateTime<*>, String>(Expect<ChronoZonedDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -2,13 +2,11 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import java.io.File
|
||||
|
||||
class FileAsPathExpectationsSpec : ch.tutteli.atrium.specs.integration.FileAsPathExpectationsSpec(
|
||||
Expect<File>::asPath
|
||||
) {
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -3,18 +3,16 @@ package ch.tutteli.atrium.api.infix.en_GB
|
||||
import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.feature0
|
||||
import ch.tutteli.atrium.specs.feature1
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import ch.tutteli.atrium.specs.withFeatureSuffix
|
||||
|
||||
class Fun0ExpectationsJvmSpec : ch.tutteli.atrium.specs.integration.Fun0ExpectationsJvmSpec(
|
||||
("toThrow" to Companion::toThrowFeature).withFeatureSuffix(),
|
||||
"toThrow" to Companion::toThrow,
|
||||
feature0<() -> Int, Int>(Expect<() -> Int>::notToThrow),
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow),
|
||||
"- ", "» "
|
||||
feature1<() -> Int, Expect<Int>.() -> Unit, Int>(Expect<() -> Int>::notToThrow)
|
||||
) {
|
||||
|
||||
companion object : WithAsciiReporter() {
|
||||
companion object {
|
||||
fun toThrowFeature(expect: Expect<out () -> Any?>) = expect.toThrow<IllegalArgumentException>()
|
||||
fun toThrow(expect: Expect<out () -> Any?>, assertionCreator: Expect<IllegalArgumentException>.() -> Unit) =
|
||||
expect.toThrow<IllegalArgumentException> { assertionCreator() }
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.property
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import java.time.DayOfWeek
|
||||
import java.time.LocalDate
|
||||
|
||||
@@ -18,7 +17,6 @@ class LocalDateExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalDateE
|
||||
property<LocalDate, DayOfWeek>(Expect<LocalDate>::dayOfWeek),
|
||||
fun1<LocalDate, Expect<DayOfWeek>.() -> Unit>(Expect<LocalDate>::dayOfWeek)
|
||||
) {
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.property
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import java.time.DayOfWeek
|
||||
import java.time.LocalDateTime
|
||||
|
||||
@@ -18,7 +17,6 @@ class LocalDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalD
|
||||
property<LocalDateTime, DayOfWeek>(Expect<LocalDateTime>::dayOfWeek),
|
||||
fun1<LocalDateTime, Expect<DayOfWeek>.() -> Unit>(Expect<LocalDateTime>::dayOfWeek)
|
||||
) {
|
||||
companion object : WithAsciiReporter()
|
||||
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
|
||||
@@ -6,7 +6,6 @@ import ch.tutteli.atrium.specs.fun0
|
||||
import ch.tutteli.atrium.specs.fun1
|
||||
import ch.tutteli.atrium.specs.integration.OptionalExpectationsSpec
|
||||
import ch.tutteli.atrium.specs.notImplemented
|
||||
import ch.tutteli.atrium.specs.testutils.WithAsciiReporter
|
||||
import java.util.*
|
||||
|
||||
class OptionalExpectationsSpec : OptionalExpectationsSpec(
|
||||
@@ -14,7 +13,8 @@ class OptionalExpectationsSpec : OptionalExpectationsSpec(
|
||||
feature0(Companion::toBePresentFeature),
|
||||
fun1(Companion::toBePresent)
|
||||
) {
|
||||
companion object : WithAsciiReporter() {
|
||||
|
||||
companion object {
|
||||
private fun toBeEmpty(expect: Expect<Optional<Int>>) = expect toBe empty
|
||||
private fun toBePresent(expect: Expect<Optional<Int>>, assertionCreator: Expect<Int>.() -> Unit) =
|
||||
expect toBe present(assertionCreator)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user