mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
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
This commit is contained in:
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -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
|
||||
```
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -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
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -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
|
||||
```
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
2
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
@@ -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
|
||||
```
|
||||
|
||||
@@ -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=```
|
||||
</ex-path-writable>
|
||||
|
||||
Even in more complicated scenarios, Atrium explains step by step what happened:
|
||||
|
||||
1
act/actions-setup-java@v1
Submodule
1
act/actions-setup-java@v1
Submodule
Submodule act/actions-setup-java@v1 added at b74d5a6a96
1
act/codecov-codecov-action@v1
Submodule
1
act/codecov-codecov-action@v1
Submodule
Submodule act/codecov-codecov-action@v1 added at e34ee48524
1
act/gradle-wrapper-validation-action@v1.0.3
Submodule
1
act/gradle-wrapper-validation-action@v1.0.3
Submodule
Submodule act/gradle-wrapper-validation-action@v1.0.3 added at e2c57acffb
@@ -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 <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): Expect<T> =
|
||||
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 <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
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 <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T> =
|
||||
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 <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
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 <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isEqual(this, expected))
|
||||
@@ -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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(expected: ChronoLocalDateTime<*>): Expect<T> =
|
||||
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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoLocalDateTime.isEqual(this, expected))
|
||||
@@ -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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = 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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isEqual(this, expected))
|
||||
@@ -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<File>` into `Expect<Path>`.
|
||||
*
|
||||
* 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 <T : File> Expect<T>.asPath(): Expect<Path> =
|
||||
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 <T : File> Expect<T>.asPath(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
apply { asPath().addAssertionsCreatedBy(assertionCreator) }
|
||||
@@ -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 <T : LocalDate> Expect<T>.year: Expect<Int>
|
||||
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 <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDate> Expect<T>.month: Expect<Int>
|
||||
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 <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
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 <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDate> Expect<T>.day: Expect<Int>
|
||||
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 <T : LocalDate> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.day(this).addToInitial(assertionCreator)
|
||||
@@ -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 <T : LocalDateTime> Expect<T>.year: Expect<Int>
|
||||
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 <T : LocalDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDateTime> Expect<T>.month: Expect<Int>
|
||||
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 <T : LocalDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
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 <T : LocalDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
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 <T : LocalDateTime> Expect<T>.day: Expect<Int>
|
||||
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 <T : LocalDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.day(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -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<T>::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 <T : Optional<*>> Expect<T>.isEmpty(): Expect<T> = 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<T>::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 <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E> = 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 <E, T : Optional<E>> Expect<T>.isPresent(assertionCreator: Expect<E>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.optional.isPresent(this).addToInitial(assertionCreator)
|
||||
@@ -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 <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
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 <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
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 <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
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 <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
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 <T : Path> Expect<T>.exists(): Expect<T> = 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 <T : Path> Expect<T>.existsNot(): Expect<T> = 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 <T : Path> Expect<T>.fileName: Expect<String>
|
||||
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 <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
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 <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
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 <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
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 <T : Path> Expect<T>.parent: Expect<Path>
|
||||
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 <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
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 <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
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 <T : Path> Expect<T>.resolve(other: String, assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
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 <T : Path> Expect<T>.isReadable(): Expect<T> = 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 <T : Path> Expect<T>.isWritable(): Expect<T> = 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 <T : Path> Expect<T>.isRegularFile(): Expect<T> = 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 <T : Path> Expect<T>.isDirectory(): Expect<T> = 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 <T : Path> Expect<T>.extension: Expect<String>
|
||||
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 <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
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 <T : Path> Expect<T>.hasSameTextualContentAs(targetPath: Path, sourceCharset: Charset = Charsets.UTF_8, targetCharset: Charset = Charsets.UTF_8): Expect<T> =
|
||||
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 <T : Path> Expect<T>.hasSameBinaryContentAs(targetPath: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.hasSameBinaryContentAs(this, targetPath))
|
||||
@@ -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 <T : ZonedDateTime> Expect<T>.year: Expect<Int>
|
||||
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 <T : ZonedDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : ZonedDateTime> Expect<T>.month: Expect<Int>
|
||||
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 <T : ZonedDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
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 <T : ZonedDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
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 <T : ZonedDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
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 <T : ZonedDateTime> Expect<T>.day: Expect<Int>
|
||||
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 <T : ZonedDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.day(this).addToInitial(assertionCreator)
|
||||
@@ -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<ChronoLocalDate>::isBefore),
|
||||
fun1(Expect<ChronoLocalDate>::isBeforeOrEqual),
|
||||
fun1(Expect<ChronoLocalDate>::isAfter),
|
||||
fun1(Expect<ChronoLocalDate>::isAfterOrEqual),
|
||||
fun1(Expect<ChronoLocalDate>::isEqual)
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun isBefore(expect: Expect<ChronoLocalDate>, expected: ChronoLocalDate): Expect<ChronoLocalDate> =
|
||||
//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<ChronoLocalDate> = notImplemented()
|
||||
var a2: Expect<LocalDate> = 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)
|
||||
}
|
||||
}
|
||||
@@ -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<ChronoLocalDateTime<*>>::isBefore),
|
||||
fun1(Expect<ChronoLocalDateTime<*>>::isBeforeOrEqual),
|
||||
fun1(Expect<ChronoLocalDateTime<*>>::isAfter),
|
||||
fun1(Expect<ChronoLocalDateTime<*>>::isAfterOrEqual),
|
||||
fun1(Expect<ChronoLocalDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun isBefore(
|
||||
expect: Expect<ChronoLocalDateTime<*>>,
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<ChronoLocalDateTime<*>> =
|
||||
//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<ChronoLocalDateTime<ChronoLocalDate>> = notImplemented()
|
||||
var a2: Expect<ChronoLocalDateTime<LocalDate>> = notImplemented()
|
||||
var a3: Expect<ChronoLocalDateTime<*>> = notImplemented()
|
||||
var a4: Expect<LocalDateTime> = 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)
|
||||
}
|
||||
}
|
||||
@@ -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<ChronoZonedDateTime<*>>::isBefore),
|
||||
fun1(Expect<ChronoZonedDateTime<*>>::isBeforeOrEqual),
|
||||
fun1(Expect<ChronoZonedDateTime<*>>::isAfter),
|
||||
fun1(Expect<ChronoZonedDateTime<*>>::isAfterOrEqual),
|
||||
fun1(Expect<ChronoZonedDateTime<*>>::isEqual)
|
||||
)
|
||||
|
||||
companion object {
|
||||
fun isBefore(
|
||||
expect: Expect<ChronoZonedDateTime<*>>,
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<ChronoZonedDateTime<*>> =
|
||||
//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<ChronoZonedDateTime<ChronoLocalDate>> = notImplemented()
|
||||
var a2: Expect<ChronoZonedDateTime<LocalDate>> = notImplemented()
|
||||
var a3: Expect<ChronoZonedDateTime<*>> = notImplemented()
|
||||
var a4: Expect<ZonedDateTime> = 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)
|
||||
}
|
||||
}
|
||||
@@ -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<File>::asPath
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var a1: Expect<File> = notImplemented()
|
||||
|
||||
a1.asPath()
|
||||
a1 = a1.asPath { }
|
||||
}
|
||||
}
|
||||
@@ -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<LocalDate, Int>(Expect<LocalDate>::year),
|
||||
fun1<LocalDate, Expect<Int>.() -> Unit>(Expect<LocalDate>::year),
|
||||
property<LocalDate, Int>(Expect<LocalDate>::month),
|
||||
fun1<LocalDate, Expect<Int>.() -> Unit>(Expect<LocalDate>::month),
|
||||
property<LocalDate, Int>(Expect<LocalDate>::day),
|
||||
fun1<LocalDate, Expect<Int>.() -> Unit>(Expect<LocalDate>::day),
|
||||
property<LocalDate, DayOfWeek>(Expect<LocalDate>::dayOfWeek),
|
||||
fun1<LocalDate, Expect<DayOfWeek>.() -> Unit>(Expect<LocalDate>::dayOfWeek)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var a1: Expect<LocalDate> = notImplemented()
|
||||
|
||||
a1.year
|
||||
a1 = a1.year { }
|
||||
|
||||
a1.month
|
||||
a1 = a1.month { }
|
||||
|
||||
a1.dayOfWeek
|
||||
a1 = a1.dayOfWeek { }
|
||||
|
||||
a1.day
|
||||
a1 = a1.day { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<LocalDateTime, Int>(Expect<LocalDateTime>::year),
|
||||
fun1<LocalDateTime, Expect<Int>.() -> Unit>(Expect<LocalDateTime>::year),
|
||||
property<LocalDateTime, Int>(Expect<LocalDateTime>::month),
|
||||
fun1<LocalDateTime, Expect<Int>.() -> Unit>(Expect<LocalDateTime>::month),
|
||||
property<LocalDateTime, Int>(Expect<LocalDateTime>::day),
|
||||
fun1<LocalDateTime, Expect<Int>.() -> Unit>(Expect<LocalDateTime>::day),
|
||||
property<LocalDateTime, DayOfWeek>(Expect<LocalDateTime>::dayOfWeek),
|
||||
fun1<LocalDateTime, Expect<DayOfWeek>.() -> Unit>(Expect<LocalDateTime>::dayOfWeek)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var a1: Expect<LocalDateTime> = notImplemented()
|
||||
|
||||
a1.year
|
||||
a1 = a1.year { }
|
||||
|
||||
a1.month
|
||||
a1 = a1.month { }
|
||||
|
||||
a1.day
|
||||
a1 = a1.day { }
|
||||
|
||||
a1.dayOfWeek
|
||||
a1 = a1.dayOfWeek { }
|
||||
}
|
||||
}
|
||||
@@ -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<Optional<Int>>::isEmpty),
|
||||
isPresentFeature = feature0<Optional<Int>, Int>(Expect<Optional<Int>>::isPresent),
|
||||
isPresent = fun1<Optional<Int>, Expect<Int>.() -> Unit>(Expect<Optional<Int>>::isPresent)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var o1: Expect<Optional<Any>> = notImplemented()
|
||||
var o1b: Expect<Optional<Any?>> = notImplemented()
|
||||
|
||||
var star: Expect<Optional<*>> = 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 {}
|
||||
}
|
||||
}
|
||||
@@ -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<Path>::exists),
|
||||
fun0(Expect<Path>::existsNot),
|
||||
fun1(Expect<Path>::startsWith),
|
||||
fun1(Expect<Path>::startsNotWith),
|
||||
fun1(Expect<Path>::endsWith),
|
||||
fun1(Expect<Path>::endsNotWith),
|
||||
fun0(Expect<Path>::isReadable),
|
||||
fun0(Expect<Path>::isWritable),
|
||||
fun0(Expect<Path>::isRegularFile),
|
||||
fun0(Expect<Path>::isDirectory),
|
||||
fun1(Expect<Path>::hasSameBinaryContentAs),
|
||||
fun3(Expect<Path>::hasSameTextualContentAs)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
val a1: Expect<DummyPath> = 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
|
||||
@@ -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<Path, Path>(Expect<Path>::parent),
|
||||
fun1<Path, Expect<Path>.() -> Unit>(Expect<Path>::parent),
|
||||
feature1<Path, String, Path>(Expect<Path>::resolve),
|
||||
fun2<Path, String, Expect<Path>.() -> Unit>(Expect<Path>::resolve),
|
||||
property<Path, String>(Expect<Path>::fileName),
|
||||
fun1<Path, Expect<String>.() -> Unit>(Expect<Path>::fileName),
|
||||
property<Path, String>(Expect<Path>::fileNameWithoutExtension),
|
||||
fun1<Path, Expect<String>.() -> Unit>(Expect<Path>::fileNameWithoutExtension),
|
||||
property<Path, String>(Expect<Path>::extension),
|
||||
fun1<Path, Expect<String>.() -> Unit>(Expect<Path>::extension)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var a1: Expect<DummyPath> = 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", {})
|
||||
}
|
||||
}
|
||||
@@ -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<ZonedDateTime, Int>(Expect<ZonedDateTime>::year),
|
||||
fun1<ZonedDateTime, Expect<Int>.() -> Unit>(Expect<ZonedDateTime>::year),
|
||||
property<ZonedDateTime, Int>(Expect<ZonedDateTime>::month),
|
||||
fun1<ZonedDateTime, Expect<Int>.() -> Unit>(Expect<ZonedDateTime>::month),
|
||||
property<ZonedDateTime, Int>(Expect<ZonedDateTime>::day),
|
||||
fun1<ZonedDateTime, Expect<Int>.() -> Unit>(Expect<ZonedDateTime>::day),
|
||||
property<ZonedDateTime, DayOfWeek>(Expect<ZonedDateTime>::dayOfWeek),
|
||||
fun1<ZonedDateTime, Expect<DayOfWeek>.() -> Unit>(Expect<ZonedDateTime>::dayOfWeek)
|
||||
) {
|
||||
@Suppress("unused", "UNUSED_VALUE")
|
||||
private fun ambiguityTest() {
|
||||
var a1: Expect<ZonedDateTime> = notImplemented()
|
||||
|
||||
a1.year
|
||||
a1 = a1.year { }
|
||||
|
||||
a1.month
|
||||
a1 = a1.month { }
|
||||
|
||||
a1.dayOfWeek
|
||||
a1 = a1.dayOfWeek { }
|
||||
|
||||
a1.day
|
||||
a1 = a1.day { }
|
||||
}
|
||||
}
|
||||
@@ -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 <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isBefore(this, expected))
|
||||
|
||||
@@ -28,6 +29,7 @@ fun <T : ChronoLocalDate> Expect<T>.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 <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isBeforeOrEquals(this, expected))
|
||||
|
||||
@@ -41,6 +43,7 @@ fun <T : ChronoLocalDate> Expect<T>.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 <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isAfter(this, expected))
|
||||
|
||||
@@ -53,6 +56,7 @@ fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T
|
||||
*
|
||||
* @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 <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isAfterOrEquals(this, expected))
|
||||
|
||||
@@ -65,5 +69,6 @@ fun <T : ChronoLocalDate> Expect<T>.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 <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isEqual(this, expected))
|
||||
|
||||
@@ -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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBefore(expected: ChronoLocalDateTime<*>): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDateTime.isBefore(this, expected))
|
||||
|
||||
@@ -29,6 +30,7 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoLocalDateTime.isBeforeOrEquals(this, expected))
|
||||
@@ -42,6 +44,7 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoLocalDateTime.isAfter(this, expected))
|
||||
@@ -55,6 +58,7 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoLocalDateTime.isAfterOrEquals(this, expected))
|
||||
@@ -68,6 +72,7 @@ fun <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoLocalDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
expected: ChronoLocalDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoLocalDateTime.isEqual(this, expected))
|
||||
|
||||
@@ -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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isBefore(this, expected))
|
||||
@@ -30,6 +31,7 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isBeforeOrEqual(this, expected))
|
||||
@@ -43,6 +45,7 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isAfter(this, expected))
|
||||
@@ -56,6 +59,7 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isAfterOrEqual(this, expected))
|
||||
@@ -69,6 +73,7 @@ fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.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 <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
): Expect<T> = addAssertion(ExpectImpl.chronoZonedDateTime.isEqual(this, expected))
|
||||
|
||||
@@ -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 <T : File> Expect<T>.asPath(): Expect<Path> =
|
||||
ExpectImpl.changeSubject(this).unreported { it.toPath() }
|
||||
|
||||
@@ -31,5 +32,6 @@ fun <T : File> Expect<T>.asPath(): Expect<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 <T : File> Expect<T>.asPath(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
apply { asPath().addAssertionsCreatedBy(assertionCreator) }
|
||||
|
||||
@@ -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 <T : LocalDate> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.localDate.year(this).getExpectOfFeature()
|
||||
|
||||
@@ -32,6 +33,7 @@ val <T : LocalDate> Expect<T>.year: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.year(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -43,6 +45,7 @@ fun <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> 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 <T : LocalDate> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.localDate.month(this).getExpectOfFeature()
|
||||
|
||||
@@ -56,6 +59,7 @@ val <T : LocalDate> Expect<T>.month: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.month(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -67,6 +71,7 @@ fun <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> 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 <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.localDate.dayOfWeek(this).getExpectOfFeature()
|
||||
|
||||
@@ -80,6 +85,7 @@ val <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
*
|
||||
* @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 <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -92,6 +98,7 @@ fun <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -
|
||||
*
|
||||
* @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 <T : LocalDate> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.localDate.day(this).getExpectOfFeature()
|
||||
|
||||
@@ -105,5 +112,6 @@ val <T : LocalDate> Expect<T>.day: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDate> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.day(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -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 <T : LocalDateTime> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.year(this).getExpectOfFeature()
|
||||
|
||||
@@ -32,6 +33,7 @@ val <T : LocalDateTime> Expect<T>.year: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.year(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -43,6 +45,7 @@ fun <T : LocalDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> 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 <T : LocalDateTime> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.month(this).getExpectOfFeature()
|
||||
|
||||
@@ -56,6 +59,7 @@ val <T : LocalDateTime> Expect<T>.month: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.month(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -67,6 +71,7 @@ fun <T : LocalDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> 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 <T : LocalDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.localDateTime.dayOfWeek(this).getExpectOfFeature()
|
||||
|
||||
@@ -80,6 +85,7 @@ val <T : LocalDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
*
|
||||
* @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 <T : LocalDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -91,6 +97,7 @@ fun <T : LocalDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.
|
||||
*
|
||||
* @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 <T : LocalDateTime> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.day(this).getExpectOfFeature()
|
||||
|
||||
@@ -104,6 +111,7 @@ val <T : LocalDateTime> Expect<T>.day: Expect<Int>
|
||||
*
|
||||
* @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 <T : LocalDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.day(this).addToInitial(assertionCreator)
|
||||
|
||||
|
||||
@@ -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 <T : Optional<*>> Expect<T>.isEmpty(): Expect<T> = addAssertion(ExpectImpl.optional.isEmpty(this))
|
||||
|
||||
/**
|
||||
@@ -32,6 +33,7 @@ fun <T : Optional<*>> Expect<T>.isEmpty(): Expect<T> = 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 <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E> = ExpectImpl.optional.isPresent(this).getExpectOfFeature()
|
||||
|
||||
/**
|
||||
@@ -43,5 +45,6 @@ fun <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E> = 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 <E, T : Optional<E>> Expect<T>.isPresent(assertionCreator: Expect<E>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.optional.isPresent(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -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 <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.startsWith(this, expected))
|
||||
|
||||
@@ -27,6 +28,7 @@ fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.startsNotWith(this, expected))
|
||||
|
||||
@@ -38,6 +40,7 @@ fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.endsWith(this, expected))
|
||||
|
||||
@@ -50,6 +53,7 @@ fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.endsNotWith(this, expected))
|
||||
|
||||
@@ -65,6 +69,7 @@ fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.exists(): Expect<T> = addAssertion(ExpectImpl.path.exists(this))
|
||||
|
||||
/**
|
||||
@@ -79,6 +84,7 @@ fun <T : Path> Expect<T>.exists(): Expect<T> = 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 <T : Path> Expect<T>.existsNot(): Expect<T> = addAssertion(ExpectImpl.path.existsNot(this))
|
||||
|
||||
/**
|
||||
@@ -90,6 +96,7 @@ fun <T : Path> Expect<T>.existsNot(): Expect<T> = 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 <T : Path> Expect<T>.fileName: Expect<String>
|
||||
get() = ExpectImpl.path.fileName(this).getExpectOfFeature()
|
||||
|
||||
@@ -104,6 +111,7 @@ val <T : Path> Expect<T>.fileName: Expect<String>
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.fileName(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -117,6 +125,7 @@ fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> 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 <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
get() = ExpectImpl.path.fileNameWithoutExtension(this).getExpectOfFeature()
|
||||
|
||||
@@ -131,6 +140,7 @@ val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.fileNameWithoutExtension(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -143,6 +153,7 @@ fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<Strin
|
||||
*
|
||||
* @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"))
|
||||
val <T : Path> Expect<T>.parent: Expect<Path>
|
||||
get() = ExpectImpl.path.parent(this).getExpectOfFeature()
|
||||
|
||||
@@ -155,6 +166,7 @@ val <T : Path> Expect<T>.parent: Expect<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.parent"))
|
||||
fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.parent(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -167,6 +179,7 @@ fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> 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 <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
ExpectImpl.path.resolve(this, other).getExpectOfFeature()
|
||||
|
||||
@@ -179,6 +192,7 @@ fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.resolve(other: String, assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.resolve(this, other).addToInitial(assertionCreator)
|
||||
|
||||
@@ -200,6 +214,7 @@ fun <T : Path> Expect<T>.resolve(other: String, assertionCreator: Expect<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.isReadable"))
|
||||
fun <T : Path> Expect<T>.isReadable(): Expect<T> = addAssertion(ExpectImpl.path.isReadable(this))
|
||||
|
||||
/**
|
||||
@@ -216,6 +231,7 @@ fun <T : Path> Expect<T>.isReadable(): Expect<T> = 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 <T : Path> Expect<T>.isWritable(): Expect<T> = addAssertion(ExpectImpl.path.isWritable(this))
|
||||
|
||||
/**
|
||||
@@ -235,6 +251,7 @@ fun <T : Path> Expect<T>.isWritable(): Expect<T> = 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 <T : Path> Expect<T>.isRegularFile(): Expect<T> = addAssertion(ExpectImpl.path.isRegularFile(this))
|
||||
|
||||
/**
|
||||
@@ -254,6 +271,7 @@ fun <T : Path> Expect<T>.isRegularFile(): Expect<T> = 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 <T : Path> Expect<T>.isDirectory(): Expect<T> = addAssertion(ExpectImpl.path.isDirectory(this))
|
||||
|
||||
/**
|
||||
@@ -265,6 +283,7 @@ fun <T : Path> Expect<T>.isDirectory(): Expect<T> = 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 <T : Path> Expect<T>.extension: Expect<String>
|
||||
get() = ExpectImpl.path.extension(this).getExpectOfFeature()
|
||||
|
||||
@@ -279,6 +298,7 @@ val <T : Path> Expect<T>.extension: Expect<String>
|
||||
*
|
||||
* @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 <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.extension(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -294,6 +314,7 @@ fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> 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 <T : Path> Expect<T>.hasSameTextualContentAs(targetPath: Path, sourceCharset: Charset = Charsets.UTF_8, targetCharset: Charset = Charsets.UTF_8): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.hasSameTextualContentAs(this, targetPath, sourceCharset, targetCharset))
|
||||
|
||||
@@ -306,5 +327,6 @@ fun <T : Path> Expect<T>.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 <T : Path> Expect<T>.hasSameBinaryContentAs(targetPath: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.hasSameBinaryContentAs(this, targetPath))
|
||||
|
||||
@@ -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 <T : ZonedDateTime> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.year(this).getExpectOfFeature()
|
||||
|
||||
@@ -32,6 +33,7 @@ val <T : ZonedDateTime> Expect<T>.year: Expect<Int>
|
||||
*
|
||||
* @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 <T : ZonedDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.year(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -43,6 +45,7 @@ fun <T : ZonedDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> 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 <T : ZonedDateTime> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.month(this).getExpectOfFeature()
|
||||
|
||||
@@ -56,6 +59,7 @@ val <T : ZonedDateTime> Expect<T>.month: Expect<Int>
|
||||
*
|
||||
* @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 <T : ZonedDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.month(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -67,6 +71,7 @@ fun <T : ZonedDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> 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 <T : ZonedDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.zonedDateTime.dayOfWeek(this).getExpectOfFeature()
|
||||
|
||||
@@ -80,6 +85,7 @@ val <T : ZonedDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
*
|
||||
* @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 <T : ZonedDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -91,6 +97,7 @@ fun <T : ZonedDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.
|
||||
*
|
||||
* @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 <T : ZonedDateTime> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.day(this).getExpectOfFeature()
|
||||
|
||||
@@ -104,5 +111,6 @@ val <T : ZonedDateTime> Expect<T>.day: Expect<Int>
|
||||
*
|
||||
* @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 <T : ZonedDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.day(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -16,6 +16,7 @@ dependencies {
|
||||
exclude module: "${rootProject.name}-translations-en_GB-jvm"
|
||||
}
|
||||
testImplementation prefixedProject('translations-de_CH-jvm')
|
||||
api niok()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.to(@Suppress("UNUSED_PARAMETER") exist: exist): Expect<T> =
|
||||
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.exists(this))
|
||||
|
||||
/**
|
||||
@@ -81,7 +80,7 @@ infix fun <T : Path> Expect<T>.to(@Suppress("UNUSED_PARAMETER") exist: exist): E
|
||||
*
|
||||
* @since 0.12.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.notTo(@Suppress("UNUSED_PARAMETER") exist: exist): Expect<T> =
|
||||
infix fun <T : Path> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.existsNot(this))
|
||||
|
||||
/**
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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<Path, exist>(Expect<Path>::to).name to Companion::exists,
|
||||
fun1<Path, exist>(Expect<Path>::notTo).name to Companion::existsNot,
|
||||
"toBe ${existing::class.simpleName}" to Companion::exists,
|
||||
"notToBe ${existing::class.simpleName}" to Companion::existsNot,
|
||||
fun1(Expect<Path>::startsWith),
|
||||
fun1(Expect<Path>::startsNotWith),
|
||||
fun1(Expect<Path>::endsWith),
|
||||
fun1(Expect<Path>::endsNotWith),
|
||||
fun1<Path, readable>(Expect<Path>::toBe).name to Companion::isReadable,
|
||||
fun1<Path, writable>(Expect<Path>::toBe).name to Companion::isWritable,
|
||||
fun1<Path, aRegularFile>(Expect<Path>::toBe).name to Companion::isRegularFile,
|
||||
fun1<Path, aDirectory>(Expect<Path>::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<Path>) = expect to exist
|
||||
private fun existsNot(expect: Expect<Path>) = expect notTo exist
|
||||
private fun exists(expect: Expect<Path>) = expect toBe existing
|
||||
private fun existsNot(expect: Expect<Path>) = expect notToBe existing
|
||||
private fun isReadable(expect: Expect<Path>) = expect toBe readable
|
||||
private fun isWritable(expect: Expect<Path>) = expect toBe writable
|
||||
private fun isRegularFile(expect: Expect<Path>) = expect toBe aRegularFile
|
||||
@@ -46,8 +45,8 @@ class PathAssertionsSpec : ch.tutteli.atrium.specs.integration.PathAssertionsSpe
|
||||
private fun ambiguityTest() {
|
||||
val a1: Expect<DummyPath> = 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")
|
||||
@@ -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.*
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
ch.tutteli.atrium.specs.testutils.AsciiBulletPointReporterFactory
|
||||
@@ -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" &&
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
@@ -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<Int>.isEven(): Expect<Int> =
|
||||
createAndAddAssertion(DescriptionBasic.IS, RawString.create("an even number")) { it % 2 == 0 }
|
||||
|
||||
fun Expect<Int>.isMultipleOf(base: Int): Expect<Int> = addAssertion(_isMultipleOf(this, base))
|
||||
|
||||
fun _isMultipleOf(expect: Expect<Int>, 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")
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user