From bf60b4ff73ae7d493fdbfa9aa68387e9e5dafbf3 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Sun, 26 Apr 2020 22:18:51 +0200 Subject: [PATCH] build windows also against JDK 11 introduce typealias CharSequenceOrNumberOrChar for Any move CharSequenceOrNumberOrChar to domain-api and use in domain-impl update setup instructions for the new infix API include the new infix API to be published preparation for accepting String instead of Zoned/LocalDate(Time) object preparation for #480, #481 and #482 refer to current milestone in good_first_issue template fix link for nullableContainer return empty message in case callee is org.spekframework.ide reduce code duplication also for jvm specs, add more cases to PathSpec fix wrong replacements and workaround KT-38721 (add import next to star) api-fluent work done commiting requested changes updated with comments adding problematic classes which break the build adding problemtic code to server to reproduce error reproducing problematic build on CI fix to build problem addressing latest comment, build should pass adjust the pseudo-keyword from exist to existing moved infix jdk8 extension to jvm module rebasing --- .github/ISSUE_TEMPLATE.md | 4 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/ISSUE_TEMPLATE/good_first_issue.md | 2 +- README.md | 8 +- act/actions-setup-java@v1 | 1 + act/codecov-codecov-action@v1 | 1 + act/gradle-wrapper-validation-action@v1.0.3 | 1 + .../fluent/en_GB/chronoLocalDateAssertions.kt | 69 ++++ .../en_GB/chronoLocalDateTimeAssertions.kt | 73 +++++ .../en_GB/chronoZonedDateTimeAssertions.kt | 74 +++++ .../atrium/api/fluent/en_GB/fileAssertions.kt | 35 ++ .../api/fluent/en_GB/localDateAssertions.kt | 109 ++++++ .../fluent/en_GB/localDateTimeAssertions.kt | 109 ++++++ .../api/fluent/en_GB/optionalAssertions.kt | 47 +++ .../atrium/api/fluent/en_GB/pathAssertions.kt | 310 ++++++++++++++++++ .../fluent/en_GB/zonedDateTimeAssertions.kt | 108 ++++++ .../en_GB/ChronoLocalDateAssertionsSpec.kt | 70 ++++ .../en_GB/ChronoLocalDateTimeAssertionSpec.kt | 89 +++++ .../en_GB/ChronoZonedDateTimeAssertionSpec.kt | 90 +++++ .../fluent/en_GB/FileAsPathAssertionsSpec.kt | 17 + .../en_GB/LocalDateFeatureAssertionsSpec.kt | 37 +++ .../LocalDateTimeFeatureAssertionsSpec.kt | 36 ++ .../fluent/en_GB/OptionalAssertionsSpec.kt | 32 ++ .../api/fluent/en_GB/PathAssertionsSpec.kt | 44 +++ .../fluent/en_GB/PathFeatureAssertionsSpec.kt | 38 +++ .../ZonedDateTimeFeatureAssertionsSpec.kt | 36 ++ .../en_GB/jdk8/chronoLocalDateAssertions.kt | 5 + .../jdk8/chronoLocalDateTimeAssertions.kt | 5 + .../jdk8/chronoZonedDateTimeAssertions.kt | 5 + .../api/fluent/en_GB/jdk8/fileAssertions.kt | 2 + .../fluent/en_GB/jdk8/localDateAssertions.kt | 8 + .../en_GB/jdk8/localDateTimeAssertions.kt | 8 + .../fluent/en_GB/jdk8/optionalAssertions.kt | 3 + .../api/fluent/en_GB/jdk8/pathAssertions.kt | 22 ++ .../en_GB/jdk8/zonedDateTimeAssertions.kt | 8 + .../jdk8/ChronoLocalDateAssertionsSpec.kt | 2 +- .../jdk8/ChronoLocalDateTimeAssertionSpec.kt | 2 +- .../jdk8/ChronoZonedDateTimeAssertionSpec.kt | 2 +- .../en_GB/jdk8/FileAsPathAssertionsSpec.kt | 2 +- .../jdk8/LocalDateFeatureAssertionsSpec.kt | 2 +- .../LocalDateTimeFeatureAssertionsSpec.kt | 2 +- .../en_GB/jdk8/OptionalAssertionsSpec.kt | 2 +- .../fluent/en_GB/jdk8/PathAssertionsSpec.kt | 2 +- .../en_GB/jdk8/PathFeatureAssertionsSpec.kt | 2 +- .../ZonedDateTimeFeatureAssertionsSpec.kt | 2 +- .../atrium/api/infix/en_GB/keywords.kt | 2 +- .../atrium-api-infix-en_GB-jvm/build.gradle | 1 + .../infix/en_GB}/chronoLocalDateAssertions.kt | 2 +- .../en_GB}/chronoLocalDateTimeAssertions.kt | 2 +- .../en_GB}/chronoZonedDateTimeAssertions.kt | 2 +- .../en_GB}/creating/path/PathWithCreator.kt | 2 +- .../atrium/api/infix/en_GB}/fileAssertions.kt | 2 +- .../api/infix/en_GB}/localDateAssertions.kt | 2 +- .../infix/en_GB}/localDateTimeAssertions.kt | 2 +- .../api/infix/en_GB}/optionalAssertions.kt | 2 +- .../atrium/api/infix/en_GB}/pathAssertions.kt | 9 +- .../infix/en_GB}/zonedDateTimeAssertions.kt | 2 +- .../src/module/module-info.java | 5 +- .../en_GB}/ChronoLocalDateAssertionsSpec.kt | 2 +- .../ChronoLocalDateTimeAssertionSpec.kt | 2 +- .../ChronoZonedDateTimeAssertionSpec.kt | 2 +- .../infix/en_GB}/FileAsPathAssertionsSpec.kt | 2 +- .../en_GB}/LocalDateFeatureAssertionsSpec.kt | 2 +- .../LocalDateTimeFeatureAssertionsSpec.kt | 2 +- .../infix/en_GB}/OptionalAssertionsSpec.kt | 2 +- .../api/infix/en_GB}/PathAssertionsSpec.kt | 23 +- .../infix/en_GB}/PathFeatureAssertionsSpec.kt | 2 +- .../ZonedDateTimeFeatureAssertionsSpec.kt | 2 +- .../src/module/module-info.java | 11 - ...h.tutteli.atrium.reporting.ReporterFactory | 1 - build.gradle | 2 +- .../src/test/kotlin/custom/SmokeSpec.kt | 7 + .../build.gradle | 10 - .../src/test/kotlin/custom/SmokeSpec.kt | 46 --- .../src/test/kotlin/module-info.java | 10 - misc/kdoc/packages.md | 4 - .../main/kotlin/readme/examples/ReadmeSpec.kt | 6 +- settings.gradle | 1 - 79 files changed, 1559 insertions(+), 145 deletions(-) create mode 160000 act/actions-setup-java@v1 create mode 160000 act/codecov-codecov-action@v1 create mode 160000 act/gradle-wrapper-validation-action@v1.0.3 create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateTimeAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/fileAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateTimeAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/optionalAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/zonedDateTimeAssertions.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeAssertionSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateFeatureAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeFeatureAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathFeatureAssertionsSpec.kt create mode 100644 apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/chronoLocalDateAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/chronoLocalDateTimeAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/chronoZonedDateTimeAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/creating/path/PathWithCreator.kt (90%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/fileAssertions.kt (96%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/localDateAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/localDateTimeAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/optionalAssertions.kt (97%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/pathAssertions.kt (97%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB}/zonedDateTimeAssertions.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/ChronoLocalDateAssertionsSpec.kt (97%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/ChronoLocalDateTimeAssertionSpec.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/ChronoZonedDateTimeAssertionSpec.kt (98%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/FileAsPathAssertionsSpec.kt (92%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/LocalDateFeatureAssertionsSpec.kt (96%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/LocalDateTimeFeatureAssertionsSpec.kt (96%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/OptionalAssertionsSpec.kt (97%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/PathAssertionsSpec.kt (76%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/PathFeatureAssertionsSpec.kt (97%) rename apis/infix-en_GB/{extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8 => atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB}/ZonedDateTimeFeatureAssertionsSpec.kt (96%) delete mode 100644 apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/module/module-info.java delete mode 100644 apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory delete mode 100644 bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/build.gradle delete mode 100644 bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/custom/SmokeSpec.kt delete mode 100644 bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/module-info.java diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2d9be9b12..288c9d315 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -5,7 +5,7 @@ Please choose the appropriate template and fill in all sections *Affected Version*: *API* (fluent-en_GB, cc or cc-infix): *Platform* (jvm, js, android): -*Extension* (none, kotlin 1.3, jdk8): none +*Extension* (none, kotlin 1.3): none ## How to reproduce the problem Consider the following code snippet @@ -25,7 +25,7 @@ A clear and concise description of what you expected to happen. # Feature Request *Platform* (jvm, js, android): -*Extension* (none, kotlin 1.3, jdk8): none +*Extension* (none, kotlin 1.3): none ## Code related feature ``` diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index af991d80a..faff4f8fe 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,7 +7,7 @@ labels: bug *Affected Version*: *API* (fluent-en_GB, cc or cc-infix): *Platform* (jvm, js, android): -*Extension* (none, kotlin 1.3, jdk8): none +*Extension* (none, kotlin 1.3): none ## How to reproduce the problem Consider the following code snippet diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index eaf0f0f29..f57b18563 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -5,7 +5,7 @@ about: Suggest an idea for this project --- *Platform* (jvm, js, android): -*Extension* (none, kotlin 1.3, jdk8): none +*Extension* (none, kotlin 1.3): none ## Code related feature ``` diff --git a/.github/ISSUE_TEMPLATE/good_first_issue.md b/.github/ISSUE_TEMPLATE/good_first_issue.md index 0ba0d026f..e8110b7db 100644 --- a/.github/ISSUE_TEMPLATE/good_first_issue.md +++ b/.github/ISSUE_TEMPLATE/good_first_issue.md @@ -4,7 +4,7 @@ about: Create a good first issue labels: good first issue, help wanted --- *Platform* (jvm, js, android): -*Extension* (none, kotlin 1.3, jdk8): none +*Extension* (none, kotlin 1.3): none ## Code related feature ``` diff --git a/README.md b/README.md index a4f887ae9..b1f3b2413 100644 --- a/README.md +++ b/README.md @@ -107,13 +107,11 @@ which provides a pure fluent API (in en_GB) for the JVM platform. Have a look at the [JVM sample projects](https://github.com/robstoll/atrium/tree/master/samples/jvm) for a quick setup. We currently provide the following extensions for the JVM platform: -- jdk8: assertion functions for JDK 8 specific types (e.g. for `Path`) - kotlin_1_3: assertion functions for Kotlin 1.3 specific types (e.g. for [Result](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/index.html)). You can enable them as follows: ``` dependencies { - testImplementation "ch.tutteli.atrium:atrium-api-fluent-en_GB-jdk8:$atrium_version" testImplementation "ch.tutteli.atrium:atrium-api-fluent-en_GB-kotlin_1_3:$atrium_version" testRuntimeOnly "ch.tutteli.atrium:atrium-domain-robstoll-kotlin_1_3:$atrium_version" } @@ -140,7 +138,6 @@ dependencies { And for the aforementioned extensions: ``` dependencies { - testImplementation "ch.tutteli.atrium:atrium-api-infix-en_GB-jdk8:$atrium_version" testImplementation "ch.tutteli.atrium:atrium-api-infix-en_GB-kotlin_1_3:$atrium_version" testRuntimeOnly "ch.tutteli.atrium:atrium-domain-robstoll-kotlin_1_3:$atrium_version" } @@ -1375,9 +1372,8 @@ expected that subject: /root/.ssh/config (sun.nio.fs.UnixPath <1234789>) ◆ equals: writable » failure at parent path: /root (sun.nio.fs.UnixPath <1234789>) » access was denied - » the owner is root, the group is root - » the permissions are u=rwx g= o= -``` + » the owner is root, the group is root + » the permissions are u=rwx g= o=``` Even in more complicated scenarios, Atrium explains step by step what happened: diff --git a/act/actions-setup-java@v1 b/act/actions-setup-java@v1 new file mode 160000 index 000000000..b74d5a6a9 --- /dev/null +++ b/act/actions-setup-java@v1 @@ -0,0 +1 @@ +Subproject commit b74d5a6a962763ad3655696a314a4b34df4896c2 diff --git a/act/codecov-codecov-action@v1 b/act/codecov-codecov-action@v1 new file mode 160000 index 000000000..e34ee4852 --- /dev/null +++ b/act/codecov-codecov-action@v1 @@ -0,0 +1 @@ +Subproject commit e34ee485244a5b5e6e4e1b96daa4a15c9073e4fc diff --git a/act/gradle-wrapper-validation-action@v1.0.3 b/act/gradle-wrapper-validation-action@v1.0.3 new file mode 160000 index 000000000..e2c57acff --- /dev/null +++ b/act/gradle-wrapper-validation-action@v1.0.3 @@ -0,0 +1 @@ +Subproject commit e2c57acffb2c9aa5a8dc6eda2bbae0b6e495bd4c diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateAssertions.kt new file mode 100644 index 000000000..e51901ed5 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateAssertions.kt @@ -0,0 +1,69 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.chronoLocalDate +import java.time.chrono.ChronoLocalDate + +/** + * Expects that the subject of the assertion (a [ChronoLocalDate]) + * is before the [expected] [ChronoLocalDate]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isBefore(expected: ChronoLocalDate): Expect = + addAssertion(ExpectImpl.chronoLocalDate.isBefore(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDate]) + * is before or equal the [expected] [ChronoLocalDate]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isBeforeOrEqual(expected: ChronoLocalDate): Expect = + addAssertion(ExpectImpl.chronoLocalDate.isBeforeOrEquals(this, expected)) + + +/** + * Expects that the subject of the assertion (a [ChronoLocalDate]) + * is after the [expected] [ChronoLocalDate]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isAfter(expected: ChronoLocalDate): Expect = + addAssertion(ExpectImpl.chronoLocalDate.isAfter(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDate]) + * is after or equal the [expected] [ChronoLocalDate]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isAfterOrEqual(expected: ChronoLocalDate): Expect = + addAssertion(ExpectImpl.chronoLocalDate.isAfterOrEquals(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDate]) + * is equal to the [expected] [ChronoLocalDate]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isEqual(expected: ChronoLocalDate): Expect = + addAssertion(ExpectImpl.chronoLocalDate.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateTimeAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateTimeAssertions.kt new file mode 100644 index 000000000..1b0709f7e --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateTimeAssertions.kt @@ -0,0 +1,73 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.chronoLocalDateTime +import java.time.chrono.ChronoLocalDate +import java.time.chrono.ChronoLocalDateTime + +/** + * Expects that the subject of the assertion (a [ChronoLocalDateTime]) + * is before the [expected] [ChronoLocalDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isBefore(expected: ChronoLocalDateTime<*>): Expect = + addAssertion(ExpectImpl.chronoLocalDateTime.isBefore(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDateTime]) + * is before or equal the [expected] [ChronoLocalDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isBeforeOrEqual( + expected: ChronoLocalDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isBeforeOrEquals(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDateTime]) + * is after the [expected] [ChronoLocalDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isAfter( + expected: ChronoLocalDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isAfter(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDateTime]) + * is after or equal the [expected] [ChronoLocalDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isAfterOrEqual( + expected: ChronoLocalDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isAfterOrEquals(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoLocalDateTime]) + * is equal to the [expected] [ChronoLocalDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isEqual( + expected: ChronoLocalDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt new file mode 100644 index 000000000..c7601b949 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoZonedDateTimeAssertions.kt @@ -0,0 +1,74 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.chronoZonedDateTime +import java.time.chrono.ChronoLocalDate +import java.time.chrono.ChronoZonedDateTime + +/** + * Expects that the subject of the assertion (a [ChronoZonedDateTime]) + * is before the [expected] [ChronoZonedDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isBefore( + expected: ChronoZonedDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isBefore(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoZonedDateTime]) + * is before or equals the [expected] [ChronoZonedDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isBeforeOrEqual( + expected: ChronoZonedDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isBeforeOrEqual(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoZonedDateTime]) + * is after the [expected] [ChronoZonedDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isAfter( + expected: ChronoZonedDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isAfter(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoZonedDateTime]) + * is after or equal the [expected] [ChronoZonedDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isAfterOrEqual( + expected: ChronoZonedDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isAfterOrEqual(this, expected)) + +/** + * Expects that the subject of the assertion (a [ChronoZonedDateTime]) + * is equal to the [expected] [ChronoZonedDateTime]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isEqual( + expected: ChronoZonedDateTime<*> +): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/fileAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/fileAssertions.kt new file mode 100644 index 000000000..d167c876b --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/fileAssertions.kt @@ -0,0 +1,35 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import java.io.File +import java.nio.file.Path + +/** + * Turns `Expect` into `Expect`. + * + * The transformation as such is not reflected in reporting. + * Use `feature(File::toPath)` if you want to show the transformation in reporting. + * + * @return The newly created [Expect] for the transformed subject. + * + * @since 0.9.0 + */ +fun Expect.asPath(): Expect = + ExpectImpl.changeSubject(this).unreported { it.toPath() } + +/** + * Expects that the subject of the assertion holds all assertions the given [assertionCreator] creates for + * the subject as [Path]. + * + * The transformation as such is not reflected in reporting. + * Use `feature(File::toPath, assertionCreator)` if you want to show the transformation in reporting. + * + * @return An [Expect] for the current subject of the assertion. + * + * @since 0.9.0 + */ +fun Expect.asPath(assertionCreator: Expect.() -> Unit): Expect = + apply { asPath().addAssertionsCreatedBy(assertionCreator) } diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateAssertions.kt new file mode 100644 index 000000000..d52ed7803 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateAssertions.kt @@ -0,0 +1,109 @@ +@file:Suppress( + "FINAL_UPPER_BOUND" /* remove once https://youtrack.jetbrains.com/issue/KT-34257 is fixed */, + "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ +) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.localDate +import java.time.DayOfWeek +import java.time.LocalDate + +/** + * Creates an [Expect] for the property [LocalDate.year][LocalDate.getYear] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.year: Expect + get() = ExpectImpl.localDate.year(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDate.year][LocalDate.getYear]of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDate.year(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [LocalDate.monthValue][LocalDate.getMonthValue] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.month: Expect + get() = ExpectImpl.localDate.month(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDate.monthValue][LocalDate.getMonthValue] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDate.month(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [LocalDate.getDayOfWeek] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.dayOfWeek: Expect + get() = ExpectImpl.localDate.dayOfWeek(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDate.getDayOfWeek] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDate.dayOfWeek(this).addToInitial(assertionCreator) + + +/** + * Creates an [Expect] for the property [LocalDate.dayOfMonth][LocalDate.getDayOfMonth] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.day: Expect + get() = ExpectImpl.localDate.day(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDate.dayOfMonth][LocalDate.getDayOfMonth] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDate.day(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateTimeAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateTimeAssertions.kt new file mode 100644 index 000000000..820ddedba --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/localDateTimeAssertions.kt @@ -0,0 +1,109 @@ +@file:Suppress( + "FINAL_UPPER_BOUND" /* remove once https://youtrack.jetbrains.com/issue/KT-34257 is fixed */, + "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ +) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.localDateTime +import java.time.DayOfWeek +import java.time.LocalDateTime + +/** + * Creates an [Expect] for the property [LocalDateTime.year][[LocalDateTime.getYear] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.year: Expect + get() = ExpectImpl.localDateTime.year(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDateTime.year][LocalDateTime.getYear] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDateTime.year(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [LocalDateTime.monthValue][LocalDateTime.getMonthValue] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.month: Expect + get() = ExpectImpl.localDateTime.month(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDateTime.monthValue][LocalDateTime.getMonthValue]of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDateTime.month(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [LocalDateTime.dayOfWeek][LocalDateTime.getDayOfWeek] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.dayOfWeek: Expect + get() = ExpectImpl.localDateTime.dayOfWeek(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDateTime.dayOfWeek][LocalDateTime.getDayOfWeek]of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDateTime.dayOfWeek(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [LocalDateTime.dayOfMonth][LocalDateTime.getDayOfMonth] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.day: Expect + get() = ExpectImpl.localDateTime.day(this).getExpectOfFeature() + +/** + * Expects that the property [LocalDateTime.dayOfMonth][LocalDateTime.getDayOfMonth] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.localDateTime.day(this).addToInitial(assertionCreator) + diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/optionalAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/optionalAssertions.kt new file mode 100644 index 000000000..98c85331c --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/optionalAssertions.kt @@ -0,0 +1,47 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.optional +import java.util.* + +/** + * Expects that the subject of the assertion (an [Optional]) is empty (not present). + * + * Shortcut for more or less something like `feature(Optional::isEmpty) { toBe(true) }` + * depends on the underlying implementation though. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun > Expect.isEmpty(): Expect = addAssertion(ExpectImpl.optional.isEmpty(this)) + +/** + * Expects that the subject of the assertion (an [Optional]) is present + * and returns an [Expect] for the inner type [E]. + * + * Shortcut for more or less something like `feature(Optional::get)` but with error handling; yet it + * depends on the underlying implementation though. + * + * @return The newly created [Expect] for the inner type [E]. + * @throws AssertionError Might throw an [AssertionError] if the given assertion is not a success. + * + * @since 0.9.0 + */ +fun > Expect.isPresent(): Expect = ExpectImpl.optional.isPresent(this).getExpectOfFeature() + +/** + * Expects that the subject of the assertion (an [Optional]) is present and + * that it holds all assertions the given [assertionCreator] creates. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the given assertions are not success. + * + * @since 0.9.0 + */ +fun > Expect.isPresent(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.optional.isPresent(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt new file mode 100644 index 000000000..72f369589 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt @@ -0,0 +1,310 @@ +@file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.path +import java.nio.charset.Charset +import java.nio.file.Path + +/** + * Expects that the subject of the assertion (a [Path]) starts with the [expected] [Path]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.startsWith(expected: Path): Expect = + addAssertion(ExpectImpl.path.startsWith(this, expected)) + +/** + * Expects that the subject of the assertion (a [Path]) does not start with the [expected] [Path]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.startsNotWith(expected: Path): Expect = + addAssertion(ExpectImpl.path.startsNotWith(this, expected)) + +/** + * Expects that the subject of the assertion (a [Path]) ends with the expected [Path]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.endsWith(expected: Path): Expect = + addAssertion(ExpectImpl.path.endsWith(this, expected)) + +/** + * Expects that the subject of the assertion (a [Path]) does not end with the expected [Path]; + * + * @param expected The [Path] provided to the assertion + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.endsNotWith(expected: Path): Expect = + addAssertion(ExpectImpl.path.endsNotWith(this, expected)) + +/** + * Expects that the subject of the assertion (a [Path]) exists; + * meaning that there is a file system entry at the location the [Path] points to. + * + * This matcher _resolves_ symbolic links. Therefore, if a symbolic link exists at the location the subject points to, + * then the search will continue at that location. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.exists(): Expect = addAssertion(ExpectImpl.path.exists(this)) + +/** + * Expects that the subject of the assertion (a [Path]) does not exist; + * meaning that there is no file system entry at the location the [Path] points to. + * + * This matcher _resolves_ symbolic links. Therefore, if a symbolic link exists at the location the subject points to, + * then the search will continue at that location. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.existsNot(): Expect = addAssertion(ExpectImpl.path.existsNot(this)) + +/** + * Creates an [Expect] for the property [Path.fileNameAsString][ch.tutteli.niok.fileNameAsString] + * (provided via [niok](https://github.com/robstoll/niok)) of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.fileName: Expect + get() = ExpectImpl.path.fileName(this).getExpectOfFeature() + +/** + * Expects that the property [Path.fileNameAsString][ch.tutteli.niok.fileNameAsString] + * (provided via [niok](https://github.com/robstoll/niok)) of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.fileName(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.path.fileName(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [Path.fileNameWithoutExtension][ch.tutteli.niok.fileNameWithoutExtension] + * (provided via [niok](https://github.com/robstoll/niok)) of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +val Expect.fileNameWithoutExtension: Expect + get() = ExpectImpl.path.fileNameWithoutExtension(this).getExpectOfFeature() + +/** + * Expects that the property [Path.fileNameWithoutExtension][ch.tutteli.niok.fileNameWithoutExtension] + * (provided via [niok](https://github.com/robstoll/niok)) + * of the subject of the assertion holds all assertions the given [assertionCreator] creates for it + * and returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.fileNameWithoutExtension(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.path.fileNameWithoutExtension(this).addToInitial(assertionCreator) + +/** + * Expects that this [Path] has a [parent][Path.getParent] and creates an [Expect] for it, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +val Expect.parent: Expect + get() = ExpectImpl.path.parent(this).getExpectOfFeature() + +/** + * Expects that this [Path] has a [parent][Path.getParent], that the parent holds all assertions the + * given [assertionCreator] creates for it and returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.parent(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.path.parent(this).addToInitial(assertionCreator) + +/** + * Expects that [other] resolves against this [Path] and creates an [Expect] for the resolved [Path] + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.10.0 + */ +fun Expect.resolve(other: String): Expect = + ExpectImpl.path.resolve(this, other).getExpectOfFeature() + +/** + * Expects that [other] resolves against this [Path], that the resolved [Path] holds all assertions the + * given [assertionCreator] creates for it and returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.10.0 + */ +fun Expect.resolve(other: String, assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.path.resolve(this, other).addToInitial(assertionCreator) + +/** + * Expects that the subject of the assertion (a [Path]) is readable; + * meaning that there is a file system entry at the location the [Path] points to and + * that the current thread has the permission to read from it. + * + * This matcher _resolves_ symbolic links. + * Therefore, if a symbolic link exists at the location the subject points to, + * search will continue at the location the link points at. + * + * This assertion is not atomic with respect to concurrent file system operations on the paths the assertions works on. + * Its result, in particular its extended explanations, may be wrong if such concurrent file system operations + * take place. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isReadable(): Expect = addAssertion(ExpectImpl.path.isReadable(this)) + +/** + * Expects that the subject of the assertion (a [Path]) is writable; + * meaning that there is a file system entry at the location the [Path] points to and + * that the current thread has the permission to write to it. + * + * This matcher _resolves_ symbolic links. + * Therefore, if a symbolic link exists at the location the subject points to, search will continue + * at the location the link points at. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isWritable(): Expect = addAssertion(ExpectImpl.path.isWritable(this)) + +/** + * Expects that the subject of the assertion (a [Path]) is a file; + * meaning that there is a file system entry at the location the [Path] points to and that is a regular file. + * + * This matcher _resolves_ symbolic links. + * Therefore, if a symbolic link exists at the location the subject points to, search will continue + * at the location the link points at. + * + * This assertion is not atomic with respect to concurrent file system operations on the paths the assertions works on. + * Its result, in particular its extended explanations, may be wrong if such concurrent file system operations + * take place. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isRegularFile(): Expect = addAssertion(ExpectImpl.path.isRegularFile(this)) + +/** + * Expects that the subject of the assertion (a [Path]) is a directory; + * meaning that there is a file system entry at the location the [Path] points to and that is a directory. + * + * This matcher _resolves_ symbolic links. + * Therefore, if a symbolic link exists at the location the subject points to, search will continue + * at the location the link points at. + * + * This assertion is not atomic with respect to concurrent file system operations on the paths the assertions works on. + * Its result, in particular its extended explanations, may be wrong if such concurrent file system operations + * take place. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.isDirectory(): Expect = addAssertion(ExpectImpl.path.isDirectory(this)) + +/** + * Creates an [Expect] for the property [Path.extension][ch.tutteli.niok.extension] + * (provided via [niok](https://github.com/robstoll/niok)) of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.extension: Expect + get() = ExpectImpl.path.extension(this).getExpectOfFeature() + +/** + * Expects that the property [Path.extension][ch.tutteli.niok.extension] + * (provided via [niok](https://github.com/robstoll/niok)) of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.extension(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.path.extension(this).addToInitial(assertionCreator) + +/** + * Expects that the subject of the assertion (a [Path]) has the same textual content + * as [targetPath]. + * + * @param sourceCharset source file encoding - UTF-8 per default. + * @param targetCharset target file encoding - UTF-8 per default. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.12.0 + */ +fun Expect.hasSameTextualContentAs(targetPath: Path, sourceCharset: Charset = Charsets.UTF_8, targetCharset: Charset = Charsets.UTF_8): Expect = + addAssertion(ExpectImpl.path.hasSameTextualContentAs(this, targetPath, sourceCharset, targetCharset)) + +/** + * Expects that the subject of the assertion (a [Path]) has the same binary content + * as [targetPath]. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.12.0 + */ +fun Expect.hasSameBinaryContentAs(targetPath: Path): Expect = + addAssertion(ExpectImpl.path.hasSameBinaryContentAs(this, targetPath)) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/zonedDateTimeAssertions.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/zonedDateTimeAssertions.kt new file mode 100644 index 000000000..b9dc50a14 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/zonedDateTimeAssertions.kt @@ -0,0 +1,108 @@ +@file:Suppress( + "FINAL_UPPER_BOUND" /* remove once https://youtrack.jetbrains.com/issue/KT-34257 is fixed */, + "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ +) + +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.domain.builders.ExpectImpl +import ch.tutteli.atrium.domain.builders.zonedDateTime +import java.time.DayOfWeek +import java.time.ZonedDateTime + +/** + * Creates an [Expect] for the property [ZonedDateTime.year][ZonedDateTime.getYear] of the subject of the assertion, + * so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.year: Expect + get() = ExpectImpl.zonedDateTime.year(this).getExpectOfFeature() + +/** + * Expects that the property [ZonedDateTime.year][ZonedDateTime.getYear] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.zonedDateTime.year(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [ZonedDateTime.monthValue][ZonedDateTime.getMonthValue] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.month: Expect + get() = ExpectImpl.zonedDateTime.month(this).getExpectOfFeature() + +/** + * Expects that the property [ZonedDateTime.monthValue][ZonedDateTime.getMonthValue] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.zonedDateTime.month(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [ZonedDatetime.dayOfWeek][ZonedDateTime.getDayOfWeek] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.dayOfWeek: Expect + get() = ExpectImpl.zonedDateTime.dayOfWeek(this).getExpectOfFeature() + +/** + * Expects that the property [ZonedDatetime.dayOfWeek][ZonedDateTime.getDayOfWeek] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.zonedDateTime.dayOfWeek(this).addToInitial(assertionCreator) + +/** + * Creates an [Expect] for the property [ZonedDateTime.dayOfMonth][ZonedDateTime.getDayOfMonth] + * of the subject of the assertion, so that further fluent calls are assertions about it. + * + * @return The newly created [Expect] for the extracted feature. + * + * @since 0.9.0 + */ +val Expect.day: Expect + get() = ExpectImpl.zonedDateTime.day(this).getExpectOfFeature() + +/** + * Expects that the property [ZonedDateTime.dayOfMonth][ZonedDateTime.getDayOfMonth] of the subject of the assertion + * holds all assertions the given [assertionCreator] creates for it and + * returns an [Expect] for the current subject of the assertion. + * + * @return An [Expect] for the current subject of the assertion. + * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. + * + * @since 0.9.0 + */ +fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = + ExpectImpl.zonedDateTime.day(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateAssertionsSpec.kt new file mode 100644 index 000000000..192bde808 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateAssertionsSpec.kt @@ -0,0 +1,70 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.fun1 +import ch.tutteli.atrium.specs.notImplemented +import org.spekframework.spek2.Spek +import java.time.LocalDate +import java.time.chrono.ChronoLocalDate +import java.time.chrono.JapaneseDate + +class ChronoLocalDateAssertionsSpec : Spek({ + include(ChronoLocalDateSpec) +}) { + object ChronoLocalDateSpec : ch.tutteli.atrium.specs.integration.ChronoLocalDateAssertionSpec( + fun1(Expect::isBefore), + fun1(Expect::isBeforeOrEqual), + fun1(Expect::isAfter), + fun1(Expect::isAfterOrEqual), + fun1(Expect::isEqual) + ) + + companion object { + fun isBefore(expect: Expect, expected: ChronoLocalDate): Expect = + //TODO #480 turn into string in ISO format + expect.isBefore(expected) + } + + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + val chronoLocalDate: ChronoLocalDate = notImplemented() + var a1: Expect = notImplemented() + var a2: Expect = notImplemented() + + a1 = a1.isBefore(LocalDate.now()) + a1 = a1.isBeforeOrEqual(LocalDate.now()) + a1 = a1.isAfter(LocalDate.now()) + a1 = a1.isAfterOrEqual(LocalDate.now()) + a1 = a1.isEqual(LocalDate.now()) + + a2 = a2.isBefore(LocalDate.now()) + a2 = a2.isBeforeOrEqual(LocalDate.now()) + a2 = a2.isAfter(LocalDate.now()) + a2 = a2.isAfterOrEqual(LocalDate.now()) + a2 = a2.isEqual(LocalDate.now()) + + a1 = a1.isBefore(JapaneseDate.now()) + a1 = a1.isBeforeOrEqual(JapaneseDate.now()) + a1 = a1.isAfter(JapaneseDate.now()) + a1 = a1.isAfterOrEqual(JapaneseDate.now()) + a1 = a1.isEqual(JapaneseDate.now()) + + a2 = a2.isBefore(JapaneseDate.now()) + a2 = a2.isBeforeOrEqual(JapaneseDate.now()) + a2 = a2.isAfter(JapaneseDate.now()) + a2 = a2.isAfterOrEqual(JapaneseDate.now()) + a2 = a2.isEqual(JapaneseDate.now()) + + a1 = a1.isBefore(chronoLocalDate) + a1 = a1.isBeforeOrEqual(chronoLocalDate) + a1 = a1.isAfter(chronoLocalDate) + a1 = a1.isAfterOrEqual(chronoLocalDate) + a1 = a1.isEqual(chronoLocalDate) + + a2 = a2.isBefore(chronoLocalDate) + a2 = a2.isBeforeOrEqual(chronoLocalDate) + a2 = a2.isAfter(chronoLocalDate) + a2 = a2.isAfterOrEqual(chronoLocalDate) + a2 = a2.isEqual(chronoLocalDate) + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt new file mode 100644 index 000000000..7c03d78b2 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt @@ -0,0 +1,89 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.fun1 +import ch.tutteli.atrium.specs.notImplemented +import org.spekframework.spek2.Spek +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.chrono.ChronoLocalDate +import java.time.chrono.ChronoLocalDateTime + +class ChronoLocalDateTimeAssertionSpec : Spek({ + include(ChronoLocalDateTimeSpec) +}) { + object ChronoLocalDateTimeSpec : ch.tutteli.atrium.specs.integration.ChronoLocalDateTimeAssertionSpec( + fun1(Expect>::isBefore), + fun1(Expect>::isBeforeOrEqual), + fun1(Expect>::isAfter), + fun1(Expect>::isAfterOrEqual), + fun1(Expect>::isEqual) + ) + + companion object { + fun isBefore( + expect: Expect>, + expected: ChronoLocalDateTime<*> + ): Expect> = + //TODO #481 turn into string in ISO format + expect.isBefore(expected) + } + + + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + val chronoLocalDateTime: ChronoLocalDateTime<*> = notImplemented() + var a1: Expect> = notImplemented() + var a2: Expect> = notImplemented() + var a3: Expect> = notImplemented() + var a4: Expect = notImplemented() + + a1 = a1.isBefore(LocalDateTime.now()) + a1 = a1.isBeforeOrEqual(LocalDateTime.now()) + a1 = a1.isAfter(LocalDateTime.now()) + a1 = a1.isAfterOrEqual(LocalDateTime.now()) + a1 = a1.isEqual(LocalDateTime.now()) + + a2 = a2.isBefore(LocalDateTime.now()) + a2 = a2.isBeforeOrEqual(LocalDateTime.now()) + a2 = a2.isAfter(LocalDateTime.now()) + a2 = a2.isAfterOrEqual(LocalDateTime.now()) + a2 = a2.isEqual(LocalDateTime.now()) + + a3 = a3.isBefore(LocalDateTime.now()) + a3 = a3.isBeforeOrEqual(LocalDateTime.now()) + a3 = a3.isAfter(LocalDateTime.now()) + a3 = a3.isAfterOrEqual(LocalDateTime.now()) + a3 = a3.isEqual(LocalDateTime.now()) + + a4 = a4.isBefore(LocalDateTime.now()) + a4 = a4.isBeforeOrEqual(LocalDateTime.now()) + a4 = a4.isAfter(LocalDateTime.now()) + a4 = a4.isAfterOrEqual(LocalDateTime.now()) + a4 = a4.isEqual(LocalDateTime.now()) + + a1 = a1.isBefore(chronoLocalDateTime) + a1 = a1.isBeforeOrEqual(chronoLocalDateTime) + a1 = a1.isAfter(chronoLocalDateTime) + a1 = a1.isAfterOrEqual(chronoLocalDateTime) + a1 = a1.isEqual(chronoLocalDateTime) + + a2 = a2.isBefore(chronoLocalDateTime) + a2 = a2.isBeforeOrEqual(chronoLocalDateTime) + a2 = a2.isAfter(chronoLocalDateTime) + a2 = a2.isAfterOrEqual(chronoLocalDateTime) + a2 = a2.isEqual(chronoLocalDateTime) + + a3 = a3.isBefore(chronoLocalDateTime) + a3 = a3.isBeforeOrEqual(chronoLocalDateTime) + a3 = a3.isAfter(chronoLocalDateTime) + a3 = a3.isAfterOrEqual(chronoLocalDateTime) + a3 = a3.isEqual(chronoLocalDateTime) + + a4 = a4.isBefore(chronoLocalDateTime) + a4 = a4.isBeforeOrEqual(chronoLocalDateTime) + a4 = a4.isAfter(chronoLocalDateTime) + a4 = a4.isAfterOrEqual(chronoLocalDateTime) + a4 = a4.isEqual(chronoLocalDateTime) + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeAssertionSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeAssertionSpec.kt new file mode 100644 index 000000000..423afc2ce --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeAssertionSpec.kt @@ -0,0 +1,90 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.fun1 +import ch.tutteli.atrium.specs.notImplemented +import org.spekframework.spek2.Spek +import java.time.LocalDate +import java.time.ZonedDateTime +import java.time.chrono.ChronoLocalDate +import java.time.chrono.ChronoZonedDateTime + +class ChronoZonedDateTimeAssertionSpec : Spek({ + include(ChronoLocalDateTimeAssertionSpec.ChronoLocalDateTimeSpec) +}) { + object ChronoZonedDateTimeSpec : ch.tutteli.atrium.specs.integration.ChronoZonedDateTimeAssertionSpec( + fun1(Expect>::isBefore), + fun1(Expect>::isBeforeOrEqual), + fun1(Expect>::isAfter), + fun1(Expect>::isAfterOrEqual), + fun1(Expect>::isEqual) + ) + + companion object { + fun isBefore( + expect: Expect>, + expected: ChronoZonedDateTime<*> + ): Expect> = + //TODO #482 turn into string in ISO format + expect.isBefore(expected) + } + + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + val chronoZonedDateTime: ChronoZonedDateTime<*> = notImplemented() + var a1: Expect> = notImplemented() + var a2: Expect> = notImplemented() + var a3: Expect> = notImplemented() + var a4: Expect = notImplemented() + + + a1 = a1.isBefore(ZonedDateTime.now()) + a1 = a1.isBeforeOrEqual(ZonedDateTime.now()) + a1 = a1.isAfter(ZonedDateTime.now()) + a1 = a1.isAfterOrEqual(ZonedDateTime.now()) + a1 = a1.isEqual(ZonedDateTime.now()) + + a2 = a2.isBefore(ZonedDateTime.now()) + a2 = a2.isBeforeOrEqual(ZonedDateTime.now()) + a2 = a2.isAfter(ZonedDateTime.now()) + a2 = a2.isAfterOrEqual(ZonedDateTime.now()) + a2 = a2.isEqual(ZonedDateTime.now()) + + a3 = a3.isBefore(ZonedDateTime.now()) + a3 = a3.isBeforeOrEqual(ZonedDateTime.now()) + a3 = a3.isAfter(ZonedDateTime.now()) + a3 = a3.isAfterOrEqual(ZonedDateTime.now()) + a3 = a3.isEqual(ZonedDateTime.now()) + + a4 = a4.isBefore(ZonedDateTime.now()) + a4 = a4.isBeforeOrEqual(ZonedDateTime.now()) + a4 = a4.isAfter(ZonedDateTime.now()) + a4 = a4.isAfterOrEqual(ZonedDateTime.now()) + a4 = a4.isEqual(ZonedDateTime.now()) + + + a1 = a1.isBefore(chronoZonedDateTime) + a1 = a1.isBeforeOrEqual(chronoZonedDateTime) + a1 = a1.isAfter(chronoZonedDateTime) + a1 = a1.isAfterOrEqual(chronoZonedDateTime) + a1 = a1.isEqual(chronoZonedDateTime) + + a2 = a2.isBefore(chronoZonedDateTime) + a2 = a2.isBeforeOrEqual(chronoZonedDateTime) + a2 = a2.isAfter(chronoZonedDateTime) + a2 = a2.isAfterOrEqual(chronoZonedDateTime) + a2 = a2.isEqual(chronoZonedDateTime) + + a3 = a3.isBefore(chronoZonedDateTime) + a3 = a3.isBeforeOrEqual(chronoZonedDateTime) + a3 = a3.isAfter(chronoZonedDateTime) + a3 = a3.isAfterOrEqual(chronoZonedDateTime) + a3 = a3.isEqual(chronoZonedDateTime) + + a4 = a4.isBefore(chronoZonedDateTime) + a4 = a4.isBeforeOrEqual(chronoZonedDateTime) + a4 = a4.isAfter(chronoZonedDateTime) + a4 = a4.isAfterOrEqual(chronoZonedDateTime) + a4 = a4.isEqual(chronoZonedDateTime) + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathAssertionsSpec.kt new file mode 100644 index 000000000..1ace38194 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathAssertionsSpec.kt @@ -0,0 +1,17 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.notImplemented +import java.io.File + +class FileAsPathAssertionsSpec : ch.tutteli.atrium.specs.integration.FileAsPathAssertionsSpec( + Expect::asPath +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var a1: Expect = notImplemented() + + a1.asPath() + a1 = a1.asPath { } + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateFeatureAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateFeatureAssertionsSpec.kt new file mode 100644 index 000000000..ae58faa77 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateFeatureAssertionsSpec.kt @@ -0,0 +1,37 @@ +package ch.tutteli.atrium.api.fluent.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.property +import java.time.DayOfWeek +import java.time.LocalDate + +class LocalDateFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.LocalDateFeatureAssertionsSpec( + property(Expect::year), + fun1.() -> Unit>(Expect::year), + property(Expect::month), + fun1.() -> Unit>(Expect::month), + property(Expect::day), + fun1.() -> Unit>(Expect::day), + property(Expect::dayOfWeek), + fun1.() -> Unit>(Expect::dayOfWeek) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var a1: Expect = notImplemented() + + a1.year + a1 = a1.year { } + + a1.month + a1 = a1.month { } + + a1.dayOfWeek + a1 = a1.dayOfWeek { } + + a1.day + a1 = a1.day { } + } +} + diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeFeatureAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeFeatureAssertionsSpec.kt new file mode 100644 index 000000000..533ebd330 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeFeatureAssertionsSpec.kt @@ -0,0 +1,36 @@ +package ch.tutteli.atrium.api.fluent.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.property +import java.time.DayOfWeek +import java.time.LocalDateTime + +class LocalDateTimeFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.LocalDateTimeFeatureAssertionsSpec( + property(Expect::year), + fun1.() -> Unit>(Expect::year), + property(Expect::month), + fun1.() -> Unit>(Expect::month), + property(Expect::day), + fun1.() -> Unit>(Expect::day), + property(Expect::dayOfWeek), + fun1.() -> Unit>(Expect::dayOfWeek) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var a1: Expect = notImplemented() + + a1.year + a1 = a1.year { } + + a1.month + a1 = a1.month { } + + a1.day + a1 = a1.day { } + + a1.dayOfWeek + a1 = a1.dayOfWeek { } + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalAssertionsSpec.kt new file mode 100644 index 000000000..56432ce78 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalAssertionsSpec.kt @@ -0,0 +1,32 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.* +import ch.tutteli.atrium.specs.integration.OptionalAssertionsSpec +import java.util.* + +class OptionalAssertionsSpec : OptionalAssertionsSpec( + isEmpty = fun0(Expect>::isEmpty), + isPresentFeature = feature0, Int>(Expect>::isPresent), + isPresent = fun1, Expect.() -> Unit>(Expect>::isPresent) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var o1: Expect> = notImplemented() + var o1b: Expect> = notImplemented() + + var star: Expect> = notImplemented() + + o1 = o1.isEmpty() + o1b = o1b.isEmpty() + star = star.isEmpty() + o1.isPresent() + o1b.isPresent() + // following is not supported on purpose as we don't know what type the element is in this case + // star.isPresent() + o1.isPresent {} + o1b.isPresent {} + // following is not supported on purpose as we don't know what type the element is in this case + // star.isPresent {} + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathAssertionsSpec.kt new file mode 100644 index 000000000..69ffb42c1 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathAssertionsSpec.kt @@ -0,0 +1,44 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.fun0 +import ch.tutteli.atrium.specs.fun1 +import ch.tutteli.atrium.specs.fun3 +import ch.tutteli.atrium.specs.notImplemented +import java.nio.file.Path +import java.nio.file.Paths + +class PathAssertionsSpec : ch.tutteli.atrium.specs.integration.PathAssertionsSpec( + fun0(Expect::exists), + fun0(Expect::existsNot), + fun1(Expect::startsWith), + fun1(Expect::startsNotWith), + fun1(Expect::endsWith), + fun1(Expect::endsNotWith), + fun0(Expect::isReadable), + fun0(Expect::isWritable), + fun0(Expect::isRegularFile), + fun0(Expect::isDirectory), + fun1(Expect::hasSameBinaryContentAs), + fun3(Expect::hasSameTextualContentAs) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + val a1: Expect = notImplemented() + + a1.exists() + a1.existsNot() + a1.startsWith(Paths.get("a")) + a1.startsNotWith(Paths.get("a")) + a1.endsWith(Paths.get("a")) + a1.endsNotWith(Paths.get("a")) + a1.isReadable() + a1.isWritable() + a1.isRegularFile() + a1.isDirectory() + a1.hasSameBinaryContentAs(Paths.get("a")) + a1.hasSameTextualContentAs(Paths.get("a")) + } +} + +class DummyPath(path: Path) : Path by path diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathFeatureAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathFeatureAssertionsSpec.kt new file mode 100644 index 000000000..f331abc5d --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathFeatureAssertionsSpec.kt @@ -0,0 +1,38 @@ +package ch.tutteli.atrium.api.fluent.en_GB + +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.* +import java.nio.file.Path + +class PathFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.PathFeatureAssertionsSpec( + property(Expect::parent), + fun1.() -> Unit>(Expect::parent), + feature1(Expect::resolve), + fun2.() -> Unit>(Expect::resolve), + property(Expect::fileName), + fun1.() -> Unit>(Expect::fileName), + property(Expect::fileNameWithoutExtension), + fun1.() -> Unit>(Expect::fileNameWithoutExtension), + property(Expect::extension), + fun1.() -> Unit>(Expect::extension) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var a1: Expect = notImplemented() + + a1.parent + a1 = a1.parent { } + + a1.fileName + a1 = a1.fileName { } + + a1.fileNameWithoutExtension + a1 = a1.fileNameWithoutExtension { } + + a1.extension + a1 = a1.extension { } + + a1.resolve("test") + a1.resolve("test", {}) + } +} diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt new file mode 100644 index 000000000..2efff7bbb --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt @@ -0,0 +1,36 @@ +package ch.tutteli.atrium.api.fluent.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.property +import java.time.DayOfWeek +import java.time.ZonedDateTime + +class ZonedDateTimeFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.ZonedDateTimeFeatureAssertionsSpec( + property(Expect::year), + fun1.() -> Unit>(Expect::year), + property(Expect::month), + fun1.() -> Unit>(Expect::month), + property(Expect::day), + fun1.() -> Unit>(Expect::day), + property(Expect::dayOfWeek), + fun1.() -> Unit>(Expect::dayOfWeek) +) { + @Suppress("unused", "UNUSED_VALUE") + private fun ambiguityTest() { + var a1: Expect = notImplemented() + + a1.year + a1 = a1.year { } + + a1.month + a1 = a1.month { } + + a1.dayOfWeek + a1 = a1.dayOfWeek { } + + a1.day + a1 = a1.day { } + } +} diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateAssertions.kt index c289a9eee..c789ef401 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateAssertions.kt @@ -16,6 +16,7 @@ import java.time.chrono.ChronoLocalDate * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBefore")) fun Expect.isBefore(expected: ChronoLocalDate): Expect = addAssertion(ExpectImpl.chronoLocalDate.isBefore(this, expected)) @@ -28,6 +29,7 @@ fun Expect.isBefore(expected: ChronoLocalDate): Expect< * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBeforeOrEqual")) fun Expect.isBeforeOrEqual(expected: ChronoLocalDate): Expect = addAssertion(ExpectImpl.chronoLocalDate.isBeforeOrEquals(this, expected)) @@ -41,6 +43,7 @@ fun Expect.isBeforeOrEqual(expected: ChronoLocalDate): * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isAfter")) fun Expect.isAfter(expected: ChronoLocalDate): Expect = addAssertion(ExpectImpl.chronoLocalDate.isAfter(this, expected)) @@ -53,6 +56,7 @@ fun Expect.isAfter(expected: ChronoLocalDate): Expect Expect.isAfterOrEqual(expected: ChronoLocalDate): Expect = addAssertion(ExpectImpl.chronoLocalDate.isAfterOrEquals(this, expected)) @@ -65,5 +69,6 @@ fun Expect.isAfterOrEqual(expected: ChronoLocalDate): E * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isEqual")) fun Expect.isEqual(expected: ChronoLocalDate): Expect = addAssertion(ExpectImpl.chronoLocalDate.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateTimeAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateTimeAssertions.kt index b966b8ff9..eb93383dd 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateTimeAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoLocalDateTimeAssertions.kt @@ -17,6 +17,7 @@ import java.time.chrono.ChronoLocalDateTime * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBefore")) fun > Expect.isBefore(expected: ChronoLocalDateTime<*>): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isBefore(this, expected)) @@ -29,6 +30,7 @@ fun > Expect.isBefore(expected: * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBeforeOrEqual")) fun > Expect.isBeforeOrEqual( expected: ChronoLocalDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isBeforeOrEquals(this, expected)) @@ -42,6 +44,7 @@ fun > Expect.isBeforeOrEqual( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isAfter")) fun > Expect.isAfter( expected: ChronoLocalDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isAfter(this, expected)) @@ -55,6 +58,7 @@ fun > Expect.isAfter( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isAfterOrEqual")) fun > Expect.isAfterOrEqual( expected: ChronoLocalDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isAfterOrEquals(this, expected)) @@ -68,6 +72,7 @@ fun > Expect.isAfterOrEqual( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isEqual")) fun > Expect.isEqual( expected: ChronoLocalDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoLocalDateTime.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoZonedDateTimeAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoZonedDateTimeAssertions.kt index d234a5b61..dc86d7617 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoZonedDateTimeAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/chronoZonedDateTimeAssertions.kt @@ -17,6 +17,7 @@ import java.time.chrono.ChronoZonedDateTime * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBefore")) fun > Expect.isBefore( expected: ChronoZonedDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isBefore(this, expected)) @@ -30,6 +31,7 @@ fun > Expect.isBefore( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isBeforeOrEqual")) fun > Expect.isBeforeOrEqual( expected: ChronoZonedDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isBeforeOrEqual(this, expected)) @@ -43,6 +45,7 @@ fun > Expect.isBeforeOrEqual( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isAfter")) fun > Expect.isAfter( expected: ChronoZonedDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isAfter(this, expected)) @@ -56,6 +59,7 @@ fun > Expect.isAfter( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isAfterOrEqual")) fun > Expect.isAfterOrEqual( expected: ChronoZonedDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isAfterOrEqual(this, expected)) @@ -69,6 +73,7 @@ fun > Expect.isAfterOrEqual( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isEqual")) fun > Expect.isEqual( expected: ChronoZonedDateTime<*> ): Expect = addAssertion(ExpectImpl.chronoZonedDateTime.isEqual(this, expected)) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/fileAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/fileAssertions.kt index cc47c6073..1723e78d0 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/fileAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/fileAssertions.kt @@ -17,6 +17,7 @@ import java.nio.file.Path * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.asPath")) fun Expect.asPath(): Expect = ExpectImpl.changeSubject(this).unreported { it.toPath() } @@ -31,5 +32,6 @@ fun Expect.asPath(): Expect = * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.asPath")) fun Expect.asPath(assertionCreator: Expect.() -> Unit): Expect = apply { asPath().addAssertionsCreatedBy(assertionCreator) } diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateAssertions.kt index 50286d416..1b92e3b91 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateAssertions.kt @@ -19,6 +19,7 @@ import java.time.LocalDate * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) val Expect.year: Expect get() = ExpectImpl.localDate.year(this).getExpectOfFeature() @@ -32,6 +33,7 @@ val Expect.year: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDate.year(this).addToInitial(assertionCreator) @@ -43,6 +45,7 @@ fun Expect.year(assertionCreator: Expect.() -> Unit): Ex * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) val Expect.month: Expect get() = ExpectImpl.localDate.month(this).getExpectOfFeature() @@ -56,6 +59,7 @@ val Expect.month: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDate.month(this).addToInitial(assertionCreator) @@ -67,6 +71,7 @@ fun Expect.month(assertionCreator: Expect.() -> Unit): E * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) val Expect.dayOfWeek: Expect get() = ExpectImpl.localDate.dayOfWeek(this).getExpectOfFeature() @@ -80,6 +85,7 @@ val Expect.dayOfWeek: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDate.dayOfWeek(this).addToInitial(assertionCreator) @@ -92,6 +98,7 @@ fun Expect.dayOfWeek(assertionCreator: Expect.() - * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) val Expect.day: Expect get() = ExpectImpl.localDate.day(this).getExpectOfFeature() @@ -105,5 +112,6 @@ val Expect.day: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDate.day(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateTimeAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateTimeAssertions.kt index aa3bc0d3e..d24bbfc52 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateTimeAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/localDateTimeAssertions.kt @@ -19,6 +19,7 @@ import java.time.LocalDateTime * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) val Expect.year: Expect get() = ExpectImpl.localDateTime.year(this).getExpectOfFeature() @@ -32,6 +33,7 @@ val Expect.year: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDateTime.year(this).addToInitial(assertionCreator) @@ -43,6 +45,7 @@ fun Expect.year(assertionCreator: Expect.() -> Unit) * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) val Expect.month: Expect get() = ExpectImpl.localDateTime.month(this).getExpectOfFeature() @@ -56,6 +59,7 @@ val Expect.month: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDateTime.month(this).addToInitial(assertionCreator) @@ -67,6 +71,7 @@ fun Expect.month(assertionCreator: Expect.() -> Unit * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) val Expect.dayOfWeek: Expect get() = ExpectImpl.localDateTime.dayOfWeek(this).getExpectOfFeature() @@ -80,6 +85,7 @@ val Expect.dayOfWeek: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDateTime.dayOfWeek(this).addToInitial(assertionCreator) @@ -91,6 +97,7 @@ fun Expect.dayOfWeek(assertionCreator: Expect. * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) val Expect.day: Expect get() = ExpectImpl.localDateTime.day(this).getExpectOfFeature() @@ -104,6 +111,7 @@ val Expect.day: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.localDateTime.day(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/optionalAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/optionalAssertions.kt index 8b711c4d0..dd2b992d7 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/optionalAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/optionalAssertions.kt @@ -18,6 +18,7 @@ import java.util.* * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isEmpty")) fun > Expect.isEmpty(): Expect = addAssertion(ExpectImpl.optional.isEmpty(this)) /** @@ -32,6 +33,7 @@ fun > Expect.isEmpty(): Expect = addAssertion(ExpectImpl.o * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isPresent")) fun > Expect.isPresent(): Expect = ExpectImpl.optional.isPresent(this).getExpectOfFeature() /** @@ -43,5 +45,6 @@ fun > Expect.isPresent(): Expect = ExpectImpl.optional. * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isPresent")) fun > Expect.isPresent(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.optional.isPresent(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/pathAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/pathAssertions.kt index 2ead129e2..657b79f72 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/pathAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/pathAssertions.kt @@ -16,6 +16,7 @@ import java.nio.file.Path * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.startsWith")) fun Expect.startsWith(expected: Path): Expect = addAssertion(ExpectImpl.path.startsWith(this, expected)) @@ -27,6 +28,7 @@ fun Expect.startsWith(expected: Path): Expect = * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.startsNotWith")) fun Expect.startsNotWith(expected: Path): Expect = addAssertion(ExpectImpl.path.startsNotWith(this, expected)) @@ -38,6 +40,7 @@ fun Expect.startsNotWith(expected: Path): Expect = * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.endsWith")) fun Expect.endsWith(expected: Path): Expect = addAssertion(ExpectImpl.path.endsWith(this, expected)) @@ -50,6 +53,7 @@ fun Expect.endsWith(expected: Path): Expect = * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.endsNotWith")) fun Expect.endsNotWith(expected: Path): Expect = addAssertion(ExpectImpl.path.endsNotWith(this, expected)) @@ -65,6 +69,7 @@ fun Expect.endsNotWith(expected: Path): Expect = * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.exists")) fun Expect.exists(): Expect = addAssertion(ExpectImpl.path.exists(this)) /** @@ -79,6 +84,7 @@ fun Expect.exists(): Expect = addAssertion(ExpectImpl.path.exis * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.existsNot")) fun Expect.existsNot(): Expect = addAssertion(ExpectImpl.path.existsNot(this)) /** @@ -90,6 +96,7 @@ fun Expect.existsNot(): Expect = addAssertion(ExpectImpl.path.e * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.fileName")) val Expect.fileName: Expect get() = ExpectImpl.path.fileName(this).getExpectOfFeature() @@ -104,6 +111,7 @@ val Expect.fileName: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.fileName")) fun Expect.fileName(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.path.fileName(this).addToInitial(assertionCreator) @@ -117,6 +125,7 @@ fun Expect.fileName(assertionCreator: Expect.() -> Unit): * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.fileNameWithoutExtension")) val Expect.fileNameWithoutExtension: Expect get() = ExpectImpl.path.fileNameWithoutExtension(this).getExpectOfFeature() @@ -131,6 +140,7 @@ val Expect.fileNameWithoutExtension: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.fileNameWithoutExtension")) fun Expect.fileNameWithoutExtension(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.path.fileNameWithoutExtension(this).addToInitial(assertionCreator) @@ -143,6 +153,7 @@ fun Expect.fileNameWithoutExtension(assertionCreator: Expect Expect.parent: Expect get() = ExpectImpl.path.parent(this).getExpectOfFeature() @@ -155,6 +166,7 @@ val Expect.parent: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.parent")) fun Expect.parent(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.path.parent(this).addToInitial(assertionCreator) @@ -167,6 +179,7 @@ fun Expect.parent(assertionCreator: Expect.() -> Unit): Expe * * @since 0.10.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.resolve")) fun Expect.resolve(other: String): Expect = ExpectImpl.path.resolve(this, other).getExpectOfFeature() @@ -179,6 +192,7 @@ fun Expect.resolve(other: String): Expect = * * @since 0.10.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.resolve")) fun Expect.resolve(other: String, assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.path.resolve(this, other).addToInitial(assertionCreator) @@ -200,6 +214,7 @@ fun Expect.resolve(other: String, assertionCreator: Expect.( * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isReadable")) fun Expect.isReadable(): Expect = addAssertion(ExpectImpl.path.isReadable(this)) /** @@ -216,6 +231,7 @@ fun Expect.isReadable(): Expect = addAssertion(ExpectImpl.path. * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isWritable")) fun Expect.isWritable(): Expect = addAssertion(ExpectImpl.path.isWritable(this)) /** @@ -235,6 +251,7 @@ fun Expect.isWritable(): Expect = addAssertion(ExpectImpl.path. * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isRegularFile")) fun Expect.isRegularFile(): Expect = addAssertion(ExpectImpl.path.isRegularFile(this)) /** @@ -254,6 +271,7 @@ fun Expect.isRegularFile(): Expect = addAssertion(ExpectImpl.pa * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.isDirectory")) fun Expect.isDirectory(): Expect = addAssertion(ExpectImpl.path.isDirectory(this)) /** @@ -265,6 +283,7 @@ fun Expect.isDirectory(): Expect = addAssertion(ExpectImpl.path * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.extension")) val Expect.extension: Expect get() = ExpectImpl.path.extension(this).getExpectOfFeature() @@ -279,6 +298,7 @@ val Expect.extension: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.extension")) fun Expect.extension(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.path.extension(this).addToInitial(assertionCreator) @@ -294,6 +314,7 @@ fun Expect.extension(assertionCreator: Expect.() -> Unit): * * @since 0.12.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.hasSameTextualContentAs")) fun Expect.hasSameTextualContentAs(targetPath: Path, sourceCharset: Charset = Charsets.UTF_8, targetCharset: Charset = Charsets.UTF_8): Expect = addAssertion(ExpectImpl.path.hasSameTextualContentAs(this, targetPath, sourceCharset, targetCharset)) @@ -306,5 +327,6 @@ fun Expect.hasSameTextualContentAs(targetPath: Path, sourceCharset * * @since 0.12.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.hasSameBinaryContentAs")) fun Expect.hasSameBinaryContentAs(targetPath: Path): Expect = addAssertion(ExpectImpl.path.hasSameBinaryContentAs(this, targetPath)) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/zonedDateTimeAssertions.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/zonedDateTimeAssertions.kt index 20740d426..651151018 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/zonedDateTimeAssertions.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/zonedDateTimeAssertions.kt @@ -19,6 +19,7 @@ import java.time.ZonedDateTime * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) val Expect.year: Expect get() = ExpectImpl.zonedDateTime.year(this).getExpectOfFeature() @@ -32,6 +33,7 @@ val Expect.year: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.year")) fun Expect.year(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.zonedDateTime.year(this).addToInitial(assertionCreator) @@ -43,6 +45,7 @@ fun Expect.year(assertionCreator: Expect.() -> Unit) * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) val Expect.month: Expect get() = ExpectImpl.zonedDateTime.month(this).getExpectOfFeature() @@ -56,6 +59,7 @@ val Expect.month: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.month")) fun Expect.month(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.zonedDateTime.month(this).addToInitial(assertionCreator) @@ -67,6 +71,7 @@ fun Expect.month(assertionCreator: Expect.() -> Unit * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) val Expect.dayOfWeek: Expect get() = ExpectImpl.zonedDateTime.dayOfWeek(this).getExpectOfFeature() @@ -80,6 +85,7 @@ val Expect.dayOfWeek: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.dayOfWeek")) fun Expect.dayOfWeek(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.zonedDateTime.dayOfWeek(this).addToInitial(assertionCreator) @@ -91,6 +97,7 @@ fun Expect.dayOfWeek(assertionCreator: Expect. * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) val Expect.day: Expect get() = ExpectImpl.zonedDateTime.day(this).getExpectOfFeature() @@ -104,5 +111,6 @@ val Expect.day: Expect * * @since 0.9.0 */ +@Deprecated("Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0", ReplaceWith("ch.tutteli.atrium.api.fluent.en_GB.day")) fun Expect.day(assertionCreator: Expect.() -> Unit): Expect = ExpectImpl.zonedDateTime.day(this).addToInitial(assertionCreator) diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt index a733e18e2..192bde808 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt index dc3f5cbf5..7c03d78b2 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt index 775044438..423afc2ce 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/FileAsPathAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/FileAsPathAssertionsSpec.kt index a37f78c7b..1ace38194 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/FileAsPathAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/FileAsPathAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.notImplemented diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt index b2663f91e..ae58faa77 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt index 3fd5595f7..533ebd330 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/OptionalAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/OptionalAssertionsSpec.kt index 88777edb8..56432ce78 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/OptionalAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/OptionalAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.* diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathAssertionsSpec.kt index 25f51a1db..69ffb42c1 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun0 diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathFeatureAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathFeatureAssertionsSpec.kt index 25d7a07a5..f331abc5d 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathFeatureAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.* diff --git a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt index 8ce267e87..2efff7bbb 100644 --- a/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt +++ b/apis/fluent-en_GB/extensions/jdk8/atrium-api-fluent-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.fluent.en_GB.jdk8 +package ch.tutteli.atrium.api.fluent.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/keywords.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/keywords.kt index d7755a6d7..f29c5c3e2 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/keywords.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/keywords.kt @@ -50,7 +50,7 @@ object entries : Keyword * A helper construct to allow expressing assertions about path existence. * It can be used for a parameterless function so that it has one parameter and thus can be used as infix function. */ -object exist : Keyword +object existing : Keyword /** * Represents the pseudo keyword `group` as in [within] `group`. diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle index 94fbd90d9..4afa0f1a2 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/build.gradle @@ -16,6 +16,7 @@ dependencies { exclude module: "${rootProject.name}-translations-en_GB-jvm" } testImplementation prefixedProject('translations-de_CH-jvm') + api niok() } diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateAssertions.kt index 0b64000c4..0939ee8fc 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateAssertions.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateTimeAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateTimeAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateTimeAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateTimeAssertions.kt index b3c46fcc1..477d9e790 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoLocalDateTimeAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoLocalDateTimeAssertions.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoZonedDateTimeAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoZonedDateTimeAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoZonedDateTimeAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoZonedDateTimeAssertions.kt index 22997a24b..749b627ec 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/chronoZonedDateTimeAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/chronoZonedDateTimeAssertions.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/creating/path/PathWithCreator.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/creating/path/PathWithCreator.kt similarity index 90% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/creating/path/PathWithCreator.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/creating/path/PathWithCreator.kt index e3452da6a..db492a048 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/creating/path/PathWithCreator.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/creating/path/PathWithCreator.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8.creating.path +package ch.tutteli.atrium.api.infix.en_GB.creating.path import ch.tutteli.atrium.creating.Expect diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/fileAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/fileAssertions.kt similarity index 96% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/fileAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/fileAssertions.kt index 6d22be8e4..4c6c93033 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/fileAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/fileAssertions.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.api.infix.en_GB.o import ch.tutteli.atrium.creating.Expect diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateAssertions.kt index 5f8c97509..1a267ae9d 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateAssertions.kt @@ -3,7 +3,7 @@ "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ ) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateTimeAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateTimeAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateTimeAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateTimeAssertions.kt index 232d70615..23123dc1b 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/localDateTimeAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/localDateTimeAssertions.kt @@ -3,7 +3,7 @@ "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ ) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/optionalAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/optionalAssertions.kt similarity index 97% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/optionalAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/optionalAssertions.kt index 2769a8065..e8d77fa9d 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/optionalAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/optionalAssertions.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.api.infix.en_GB.empty import ch.tutteli.atrium.api.infix.en_GB.present diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/pathAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt similarity index 97% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/pathAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt index 846d1095d..883b226c0 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/pathAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt @@ -1,9 +1,8 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.infix.en_GB.jdk8.creating.path.PathWithCreator +import ch.tutteli.atrium.api.infix.en_GB.creating.path.PathWithCreator import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl import ch.tutteli.atrium.domain.builders.path @@ -66,7 +65,7 @@ infix fun Expect.endsNotWith(expected: Path): Expect = * * @since 0.12.0 */ -infix fun Expect.to(@Suppress("UNUSED_PARAMETER") exist: exist): Expect = +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect = addAssertion(ExpectImpl.path.exists(this)) /** @@ -81,7 +80,7 @@ infix fun Expect.to(@Suppress("UNUSED_PARAMETER") exist: exist): E * * @since 0.12.0 */ -infix fun Expect.notTo(@Suppress("UNUSED_PARAMETER") exist: exist): Expect = +infix fun Expect.notToBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect = addAssertion(ExpectImpl.path.existsNot(this)) /** diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/zonedDateTimeAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/zonedDateTimeAssertions.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/zonedDateTimeAssertions.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/zonedDateTimeAssertions.kt index 6ca2086e5..f4f8e57a0 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/zonedDateTimeAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/zonedDateTimeAssertions.kt @@ -3,7 +3,7 @@ "JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE" /* TODO remove once https://youtrack.jetbrains.com/issue/KT-35343 is fixed */ ) -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/module/module-info.java b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/module/module-info.java index 921dbaa27..a2665fce1 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/module/module-info.java +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/module/module-info.java @@ -1,7 +1,9 @@ module ch.tutteli.atrium.api.infix.en_GB { requires ch.tutteli.atrium.domain.builders; requires kotlin.stdlib; - + requires java.base; + requires ch.tutteli.kbox; + requires ch.tutteli.niok; exports ch.tutteli.atrium.api.infix.en_GB; exports ch.tutteli.atrium.api.infix.en_GB.creating; @@ -10,5 +12,6 @@ module ch.tutteli.atrium.api.infix.en_GB { exports ch.tutteli.atrium.api.infix.en_GB.creating.iterable; exports ch.tutteli.atrium.api.infix.en_GB.creating.iterable.contains.builders; exports ch.tutteli.atrium.api.infix.en_GB.creating.map; + exports ch.tutteli.atrium.api.infix.en_GB.creating.path; exports ch.tutteli.atrium.api.infix.en_GB.workaround; } diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateAssertionsSpec.kt similarity index 97% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateAssertionsSpec.kt index b7b850146..86d1cfddf 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeAssertionSpec.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeAssertionSpec.kt index 8db4f832d..39727f401 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoLocalDateTimeAssertionSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeAssertionSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeAssertionSpec.kt similarity index 98% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeAssertionSpec.kt index ecebc17d6..b1da519f8 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ChronoZonedDateTimeAssertionSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeAssertionSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/FileAsPathAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathAssertionsSpec.kt similarity index 92% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/FileAsPathAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathAssertionsSpec.kt index e3da3d421..643989d54 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/FileAsPathAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.api.infix.en_GB.o import ch.tutteli.atrium.creating.Expect diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateFeatureAssertionsSpec.kt similarity index 96% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateFeatureAssertionsSpec.kt index 7355cb2e7..74e242904 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateFeatureAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeFeatureAssertionsSpec.kt similarity index 96% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeFeatureAssertionsSpec.kt index 02a2a8f60..ca9b38c18 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/LocalDateTimeFeatureAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/OptionalAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalAssertionsSpec.kt similarity index 97% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/OptionalAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalAssertionsSpec.kt index 2fc497b83..9b4a9565d 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/OptionalAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.api.infix.en_GB.empty import ch.tutteli.atrium.api.infix.en_GB.present diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathAssertionsSpec.kt similarity index 76% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathAssertionsSpec.kt index fbcbe6d8c..47910e15f 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathAssertionsSpec.kt @@ -1,6 +1,5 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB -import ch.tutteli.atrium.api.infix.en_GB.* import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl import ch.tutteli.atrium.domain.builders.path @@ -13,23 +12,23 @@ import java.nio.file.Path import java.nio.file.Paths class PathAssertionsSpec : ch.tutteli.atrium.specs.integration.PathAssertionsSpec( - fun1(Expect::to).name to Companion::exists, - fun1(Expect::notTo).name to Companion::existsNot, + "toBe ${existing::class.simpleName}" to Companion::exists, + "notToBe ${existing::class.simpleName}" to Companion::existsNot, fun1(Expect::startsWith), fun1(Expect::startsNotWith), fun1(Expect::endsWith), fun1(Expect::endsNotWith), - fun1(Expect::toBe).name to Companion::isReadable, - fun1(Expect::toBe).name to Companion::isWritable, - fun1(Expect::toBe).name to Companion::isRegularFile, - fun1(Expect::toBe).name to Companion::isDirectory, + "toBe ${readable::class.simpleName}" to Companion::isReadable, + "toBe ${writable::class.simpleName}" to Companion::isWritable, + "toBe ${aRegularFile::class.simpleName}" to Companion::isRegularFile, + "toBe ${aDirectory::class.simpleName}" to Companion::isDirectory, "not supported in this API - hasSameBinaryContentAs" to Companion::hasSameBinaryContentAs, "not supported in this API - hasSameTextualContentAs" to Companion::hasSameTextualContentAs ) { companion object : WithAsciiReporter() { - private fun exists(expect: Expect) = expect to exist - private fun existsNot(expect: Expect) = expect notTo exist + private fun exists(expect: Expect) = expect toBe existing + private fun existsNot(expect: Expect) = expect notToBe existing private fun isReadable(expect: Expect) = expect toBe readable private fun isWritable(expect: Expect) = expect toBe writable private fun isRegularFile(expect: Expect) = expect toBe aRegularFile @@ -46,8 +45,8 @@ class PathAssertionsSpec : ch.tutteli.atrium.specs.integration.PathAssertionsSpe private fun ambiguityTest() { val a1: Expect = notImplemented() - a1 to exist - a1 notTo exist + a1 toBe existing + a1 notToBe existing a1 startsWith Paths.get("a") a1 startsNotWith Paths.get("a") a1 endsWith Paths.get("a") diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathFeatureAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathFeatureAssertionsSpec.kt similarity index 97% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathFeatureAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathFeatureAssertionsSpec.kt index 9cc4619fa..33cd8d7b3 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/PathFeatureAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.* diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt similarity index 96% rename from apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt rename to apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt index ba168a1ab..780439617 100644 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/jdk8/ZonedDateTimeFeatureAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeFeatureAssertionsSpec.kt @@ -1,4 +1,4 @@ -package ch.tutteli.atrium.api.infix.en_GB.jdk8 +package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.fun1 diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/module/module-info.java b/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/module/module-info.java deleted file mode 100644 index 26d81d3a6..000000000 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/module/module-info.java +++ /dev/null @@ -1,11 +0,0 @@ -module ch.tutteli.atrium.api.infix.en_GB.jdk8 { - requires ch.tutteli.atrium.api.infix.en_GB; - requires ch.tutteli.atrium.domain.builders; - requires ch.tutteli.kbox; - requires ch.tutteli.niok; - requires kotlin.stdlib; - requires java.base; - - exports ch.tutteli.atrium.api.infix.en_GB.jdk8; - exports ch.tutteli.atrium.api.infix.en_GB.jdk8.creating.path; -} diff --git a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory b/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory deleted file mode 100644 index 111322a35..000000000 --- a/apis/infix-en_GB/extensions/jdk8/atrium-api-infix-en_GB-jdk8-jvm/src/test/resources/META-INF/services/ch.tutteli.atrium.reporting.ReporterFactory +++ /dev/null @@ -1 +0,0 @@ -ch.tutteli.atrium.specs.testutils.AsciiBulletPointReporterFactory diff --git a/build.gradle b/build.gradle index b2b35b5db..36e4d9db9 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ buildscript { // gh-pages.gradle docProjects = (subprojects - sampleProjectsFun - toolProjectsFun).findAll { - !it.name.endsWith("-js") && + !it.name.endsWith("-js") && !it.name.endsWith("-android") && !it.name.contains("robstoll") && it.name != "${rootProject.name}-spec" && diff --git a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/test/kotlin/custom/SmokeSpec.kt b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/test/kotlin/custom/SmokeSpec.kt index c373c5b01..4392ef129 100644 --- a/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/test/kotlin/custom/SmokeSpec.kt +++ b/bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/test/kotlin/custom/SmokeSpec.kt @@ -1,7 +1,9 @@ package custom +import ch.tutteli.atrium.api.fluent.en_GB.existsNot import ch.tutteli.atrium.api.fluent.en_GB.toBe import ch.tutteli.atrium.api.verbs.assertThat +import ch.tutteli.atrium.api.verbs.assert import ch.tutteli.atrium.assertions.Assertion import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl @@ -10,12 +12,17 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable import ch.tutteli.atrium.translations.DescriptionBasic import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe +import java.nio.file.Paths object SmokeSpec : Spek({ test("see if `toBe` can be used") { assertThat(1).toBe(1) } + test("see if `Path.existsNot` can be used") { + assert(Paths.get("nonExisting")).existsNot() + } + test("see if own assertion function without i18n can be used") { assertThat(2).isEven() } diff --git a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/build.gradle b/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/build.gradle deleted file mode 100644 index 6e6d2fa96..000000000 --- a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -description = "Represents a JDK >= 9 smoke test for atrium-fluent-en_GB with jdk8 extension" - -sourceCompatibility = JavaVersion.current() -targetCompatibility = JavaVersion.current() - -dependencies { - //I don't see how to set up compileTestKotlin with --patch-module, so we have put the module-info.java directly in src/test/kotlin instead - testImplementation prefixedProject('fluent-en_GB-jvm') - testImplementation prefixedProject('api-fluent-en_GB-jdk8-jvm') -} diff --git a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/custom/SmokeSpec.kt b/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/custom/SmokeSpec.kt deleted file mode 100644 index 98766434b..000000000 --- a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/custom/SmokeSpec.kt +++ /dev/null @@ -1,46 +0,0 @@ -package custom - -import ch.tutteli.atrium.api.fluent.en_GB.jdk8.existsNot -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.assert -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.domain.builders.ExpectImpl -import ch.tutteli.atrium.reporting.RawString -import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable -import ch.tutteli.atrium.translations.DescriptionBasic -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe -import java.nio.file.Paths - -object SmokeSpec : Spek({ - test("see if `toBe` can be used") { - assert(1).toBe(1) - } - - test("see if `Path.existsNot` can be used") { - assert(Paths.get("nonExisting")).existsNot() - } - - test("see if own assertion function without i18n can be used") { - assert(2).isEven() - } - - test("see if own assertion function with i18n can be used") { - assert(4).isMultipleOf(2) - } -}) - -fun Expect.isEven(): Expect = - createAndAddAssertion(DescriptionBasic.IS, RawString.create("an even number")) { it % 2 == 0 } - -fun Expect.isMultipleOf(base: Int): Expect = addAssertion(_isMultipleOf(this, base)) - -fun _isMultipleOf(expect: Expect, base: Int): Assertion = - ExpectImpl.builder.createDescriptive(expect, DescriptionIntAssertions.IS_MULTIPLE_OF, base) { - it % base == 0 - } - -enum class DescriptionIntAssertions(override val value: String) : StringBasedTranslatable { - IS_MULTIPLE_OF("is multiple of") -} diff --git a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/module-info.java b/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/module-info.java deleted file mode 100644 index 9b7496264..000000000 --- a/bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/module-info.java +++ /dev/null @@ -1,10 +0,0 @@ -module ch.tutteli.atrium.fluent.en_GB.jdk8.smoke { - // test dependencies are usually defined in build.gradle via --patch-module but that's quite cumbersome and I did - // not get it running in 10 minutes so I am using this, the effect should be the same, the kotlin compiler checks if - // I am using symbols from packages I do not require etc. - - requires ch.tutteli.atrium.fluent.en_GB; - requires ch.tutteli.atrium.api.fluent.en_GB.jdk8; - requires kotlin.stdlib; - requires spek.dsl.jvm; -} diff --git a/misc/kdoc/packages.md b/misc/kdoc/packages.md index 9f1fb0b95..71032a7c0 100644 --- a/misc/kdoc/packages.md +++ b/misc/kdoc/packages.md @@ -20,7 +20,6 @@ API modules: focus of this API's design is put on ease of use/compatibility with code completion functionality of an IDE. It is a pure fluent API. extensions: - - **atrium-api-fluent-en_GB-jdk8** provides additional assertion functions for types introduced with JDK 8 (e.g. for `Path`) - **atrium-api-fluent-en_GB-kotlin_1_3** provides additional assertion functions for types introduced in Kotlin 1.3 (e.g. for `Result`) - **atrium-api-cc-infix-en_GB** provides an assertion function API in English where the main @@ -141,9 +140,6 @@ assertions for CharSequence. Contains the builders - necessary to provide an extensible fluent API - which allow to create sophisticated `contains` assertions for Iterable. -# ch.tutteli.atrium.api.fluent.en_GB.jdk8 -Contains an API for types introduced with JDK 8 - # ch.tutteli.atrium.api.fluent.en_GB.kotlin_1_3 Contains an API for types introduced with Kotlin 1.3 diff --git a/misc/tools/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt b/misc/tools/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt index 6e927dce6..7bdbb4f00 100644 --- a/misc/tools/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt +++ b/misc/tools/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt @@ -4,9 +4,9 @@ package readme.examples import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.expect //snippet-import-end -import ch.tutteli.atrium.api.fluent.en_GB.jdk8.exists -import ch.tutteli.atrium.api.fluent.en_GB.jdk8.isRegularFile -import ch.tutteli.atrium.api.fluent.en_GB.jdk8.isWritable +import ch.tutteli.atrium.api.fluent.en_GB.exists +import ch.tutteli.atrium.api.fluent.en_GB.isRegularFile +import ch.tutteli.atrium.api.fluent.en_GB.isWritable import ch.tutteli.atrium.assertions.Assertion import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.domain.builders.ExpectImpl diff --git a/settings.gradle b/settings.gradle index 109c168f9..65ef4cec4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -36,7 +36,6 @@ def bundleWithExtensionsAndSmokeTest = { self, String apiName -> self.folder(apiName) { _ "$apiName-smoke-test" folder("extensions") { - _ "$apiName-smoke-test-jdk8" _ "$apiName-smoke-test-kotlin_1_3" } }