mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
switch default branch from master to main
This commit is contained in:
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@@ -12,7 +12,7 @@ Following a few guidelines so that others can quickly benefit from your contribu
|
|||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
This project and everyone participating in it is governed by Atrium's
|
This project and everyone participating in it is governed by Atrium's
|
||||||
[Code of Conduct](https://github.com/robstoll/atrium/tree/master/.github/CODE_OF_CONDUCT.md).
|
[Code of Conduct](https://github.com/robstoll/atrium/tree/main/.github/CODE_OF_CONDUCT.md).
|
||||||
By participating, you are expected to uphold this code. Please report unacceptable behaviour to info@tutteli.ch
|
By participating, you are expected to uphold this code. Please report unacceptable behaviour to info@tutteli.ch
|
||||||
|
|
||||||
## How to Contribute
|
## How to Contribute
|
||||||
@@ -111,7 +111,7 @@ Dealing with Git for the first time? Here are some recommendations for how to se
|
|||||||
`git remote add upstream https://github.com/robstoll/atrium.git`. You will use this to
|
`git remote add upstream https://github.com/robstoll/atrium.git`. You will use this to
|
||||||
fetch changes made in this repository.
|
fetch changes made in this repository.
|
||||||
- to ensure your branch is up-to-date, rebase your work on
|
- to ensure your branch is up-to-date, rebase your work on
|
||||||
upstream/master using `git rebase upstream/master` or `git pull -r upstream master`.
|
upstream/main using `git rebase upstream/main` or `git pull -r upstream main`.
|
||||||
This will add all new changes in this repository into your branch and place your
|
This will add all new changes in this repository into your branch and place your
|
||||||
local unpushed changes at the top of the branch.
|
local unpushed changes at the top of the branch.
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ However, here a few hints in order that your pull request is merged quickly.
|
|||||||
|
|
||||||
## Pull Request Checklist
|
## Pull Request Checklist
|
||||||
Please make sure you can check every item on the following list before you create a pull request:
|
Please make sure you can check every item on the following list before you create a pull request:
|
||||||
- [ ] your pull request is rebased on the [latest commit on master](https://github.com/robstoll/atrium/commits/master)
|
- [ ] your pull request is rebased on the [latest commit on main](https://github.com/robstoll/atrium/commits/main)
|
||||||
- [ ] Your pull request addresses only “one thing”. It cannot be meaningfully split up into multiple pull requests.
|
- [ ] Your pull request addresses only “one thing”. It cannot be meaningfully split up into multiple pull requests.
|
||||||
|
|
||||||
Once you have created and submitted your pull request, make sure:
|
Once you have created and submitted your pull request, make sure:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
2
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
@@ -48,6 +48,6 @@ A clear and concise description of any alternative solutions or features you've
|
|||||||
## Your first contribution?
|
## Your first contribution?
|
||||||
- Write a comment `I'll work on this` if you would like to take this issue over.
|
- Write a comment `I'll work on this` if you would like to take this issue over.
|
||||||
This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
|
This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
|
||||||
- See [Your first code contribution](https://github.com/robstoll/atrium/blob/master/.github/CONTRIBUTING.md#your-first-code-contribution) for guidelines.
|
- See [Your first code contribution](https://github.com/robstoll/atrium/blob/main/.github/CONTRIBUTING.md#your-first-code-contribution) for guidelines.
|
||||||
- Do not hesitate to ask questions here or to contact us via [Atrium's slack channel](https://kotlinlang.slack.com/team/U3DE1TXKP) if you need help
|
- Do not hesitate to ask questions here or to contact us via [Atrium's slack channel](https://kotlinlang.slack.com/team/U3DE1TXKP) if you need help
|
||||||
([Invite yourself](https://slack.kotlinlang.org/) in case you do not have an account yet).
|
([Invite yourself](https://slack.kotlinlang.org/) in case you do not have an account yet).
|
||||||
|
|||||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
______________________________________
|
______________________________________
|
||||||
I confirm that I have read the [Contributor Agreements v1.0](https://github.com/robstoll/atrium/blob/master/.github/Contributor%20Agreements%20v1.0.txt), agree to be bound on them and confirm that my contribution is compliant.
|
I confirm that I have read the [Contributor Agreements v1.0](https://github.com/robstoll/atrium/blob/main/.github/Contributor%20Agreements%20v1.0.txt), agree to be bound on them and confirm that my contribution is compliant.
|
||||||
|
|||||||
1
.github/codecov.yml
vendored
1
.github/codecov.yml
vendored
@@ -14,6 +14,7 @@ coverage:
|
|||||||
target: 85%
|
target: 85%
|
||||||
|
|
||||||
codecov:
|
codecov:
|
||||||
|
branch: main
|
||||||
notify:
|
notify:
|
||||||
after_n_builds: 5
|
after_n_builds: 5
|
||||||
comment:
|
comment:
|
||||||
|
|||||||
2
.github/workflows/bbc-ubuntu.yml
vendored
2
.github/workflows/bbc-ubuntu.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload windows build code coverage
|
- name: Upload windows build code coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
|
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: bbc
|
flags: bbc
|
||||||
|
|||||||
2
.github/workflows/bc-ubuntu.yml
vendored
2
.github/workflows/bc-ubuntu.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload windows build code coverage
|
- name: Upload windows build code coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
|
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: bc
|
flags: bc
|
||||||
|
|||||||
2
.github/workflows/build-ubuntu.yml
vendored
2
.github/workflows/build-ubuntu.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload build code coverage
|
- name: Upload build code coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
|
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||||
env:
|
env:
|
||||||
JAVA_VERSION: ${{ matrix.java_version }}
|
JAVA_VERSION: ${{ matrix.java_version }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/build-windows.yml
vendored
4
.github/workflows/build-windows.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
md android-jar-cache
|
md android-jar-cache
|
||||||
cd android-jar-cache
|
cd android-jar-cache
|
||||||
curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-${{ env.android-version }}/android.jar?raw=true"
|
curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/main/android-${{ env.android-version }}/android.jar?raw=true"
|
||||||
$file_sha256 = $(certutil -hashfile android.jar sha256)[1] -replace " ",""
|
$file_sha256 = $(certutil -hashfile android.jar sha256)[1] -replace " ",""
|
||||||
$expected_sha256 = "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa"
|
$expected_sha256 = "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa"
|
||||||
if ($file_sha256 -Ne $expected_sha256) {
|
if ($file_sha256 -Ne $expected_sha256) {
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload windows build code coverage
|
- name: Upload windows build code coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
|
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||||
env:
|
env:
|
||||||
JAVA_VERSION: ${{ matrix.java_version }}
|
JAVA_VERSION: ${{ matrix.java_version }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: Generate README examples
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
200
README.md
200
README.md
@@ -1,11 +1,11 @@
|
|||||||
<!-- for master -->
|
<!-- for main -->
|
||||||
|
|
||||||
[](https://search.maven.org/artifact/ch.tutteli.atrium/atrium-fluent-en_GB/0.17.0-RC1/jar)
|
[](https://search.maven.org/artifact/ch.tutteli.atrium/atrium-fluent-en_GB/0.17.0-RC1/jar)
|
||||||
[](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License")
|
[](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License")
|
||||||
[](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ")
|
[](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ")
|
||||||
[](https://github.com/robstoll/atrium/actions?query=workflow%3AUbuntu+branch%3Amaster)
|
[](https://github.com/robstoll/atrium/actions?query=workflow%3AUbuntu+branch%3Amain)
|
||||||
[](https://github.com/robstoll/atrium/actions?query=workflow%3AWindows+branch%3Amaster)
|
[](https://github.com/robstoll/atrium/actions?query=workflow%3AWindows+branch%3Amain)
|
||||||
[](https://codecov.io/github/robstoll/atrium/branch/master)
|
[](https://codecov.io/github/robstoll/atrium/branch/main)
|
||||||
[](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help")
|
[](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help")
|
||||||
|
|
||||||
<!-- for a specific release -->
|
<!-- for a specific release -->
|
||||||
@@ -102,8 +102,8 @@ dependencies {
|
|||||||
We have defined a dependency to the bundle `atrium-fluent-en_GB` in the above example
|
We have defined a dependency to the bundle `atrium-fluent-en_GB` in the above example
|
||||||
which provides a pure fluent API (in en_GB) for the JVM platform.
|
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, or
|
Have a look at the [JVM sample projects](https://github.com/robstoll/atrium/tree/main/samples/jvm) for a quick setup, or
|
||||||
[Maven sample project](https://github.com/robstoll/atrium/tree/master/samples/maven) if you prefer Maven to Gradle.
|
[Maven sample project](https://github.com/robstoll/atrium/tree/main/samples/maven) if you prefer Maven to Gradle.
|
||||||
|
|
||||||
We currently provide the following extensions for the JVM platform:
|
We currently provide the following extensions for the JVM platform:
|
||||||
- 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)).
|
- 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)).
|
||||||
@@ -143,7 +143,7 @@ dependencies {
|
|||||||
|
|
||||||
*maven*:
|
*maven*:
|
||||||
Because maven is a bit more verbose than gradle, the example is not listed here but a
|
Because maven is a bit more verbose than gradle, the example is not listed here but a
|
||||||
[sample maven project](https://github.com/robstoll/atrium/tree/master/samples/maven)
|
[sample maven project](https://github.com/robstoll/atrium/tree/main/samples/maven)
|
||||||
is provided which shows all necessary setup.
|
is provided which shows all necessary setup.
|
||||||
|
|
||||||
That is all, you are all set. Jump to [Examples](#examples) which shows how to use Atrium.
|
That is all, you are all set. Jump to [Examples](#examples) which shows how to use Atrium.
|
||||||
@@ -163,19 +163,19 @@ dependencies {
|
|||||||
We have defined a dependency to the bundle `atrium-fluent-en_GB-js` in the above example
|
We have defined a dependency to the bundle `atrium-fluent-en_GB-js` in the above example
|
||||||
which provides a pure fluent API (in en_GB) for the JS platform.
|
which provides a pure fluent API (in en_GB) for the JS platform.
|
||||||
|
|
||||||
Have a look at the [JS sample projects](https://github.com/robstoll/atrium/tree/master/samples/jvm) for a quick setup.
|
Have a look at the [JS sample projects](https://github.com/robstoll/atrium/tree/main/samples/jvm) for a quick setup.
|
||||||
|
|
||||||
Otherwise, you need to setup an explicit dependency on `atrium-fluent-en_GB-js` in your test code in order that you can use Atrium.
|
Otherwise, you need to setup an explicit dependency on `atrium-fluent-en_GB-js` in your test code in order that you can use Atrium.
|
||||||
This is due to the loosely coupled design of Atrium and dead code elimination performed by the Kotlin compiler for JS.
|
This is due to the loosely coupled design of Atrium and dead code elimination performed by the Kotlin compiler for JS.
|
||||||
|
|
||||||
Atrium itself is using mocha as well
|
Atrium itself is using mocha as well
|
||||||
(see [build.gradle -> createJsTestTask](https://github.com/robstoll/atrium/tree/master/build.gradle#L290))
|
(see [build.gradle -> createJsTestTask](https://github.com/robstoll/atrium/tree/main/build.gradle#L290))
|
||||||
and has tests written in JS modules
|
and has tests written in JS modules
|
||||||
(see [AdjustStackTest](https://github.com/robstoll/atrium/tree/master/core/atrium-core-js/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt))
|
(see [AdjustStackTest](https://github.com/robstoll/atrium/tree/main/core/atrium-core-js/src/test/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt))
|
||||||
as well as tests written in common modules (e.g. [SmokeTest](https://github.com/robstoll/atrium/tree/master/bundles/fluent-en_GB/atrium-fluent-en_GB-common/src/test/kotlin/SmokeTest.kt))
|
as well as tests written in common modules (e.g. [SmokeTest](https://github.com/robstoll/atrium/tree/main/bundles/fluent-en_GB/atrium-fluent-en_GB-common/src/test/kotlin/SmokeTest.kt))
|
||||||
which are executed on the JS platform as well
|
which are executed on the JS platform as well
|
||||||
(actually on all platforms -> JVM uses JUnit for this purpose, see
|
(actually on all platforms -> JVM uses JUnit for this purpose, see
|
||||||
[build.gradle -> useJupiter](https://github.com/robstoll/atrium/tree/master/build.gradle#L342)).
|
[build.gradle -> useJupiter](https://github.com/robstoll/atrium/tree/main/build.gradle#L342)).
|
||||||
|
|
||||||
We currently provide the following extensions for the JS platform:
|
We currently provide the following extensions for the JS platform:
|
||||||
- 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)).
|
- 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)).
|
||||||
@@ -225,16 +225,16 @@ The setup for using Atrium in a common module of a multiplatform project is basi
|
|||||||
For instance `atrium-fluent-en_GB-common` instead of `atrium-fluent-en_GB`.
|
For instance `atrium-fluent-en_GB-common` instead of `atrium-fluent-en_GB`.
|
||||||
|
|
||||||
Have a look at [JVM](#jvm), [JS](#js) or [Android](#android) to see how the setup of a specific platform has to be done.
|
Have a look at [JVM](#jvm), [JS](#js) or [Android](#android) to see how the setup of a specific platform has to be done.
|
||||||
You might want to have a look at the [Multiplatform sample project](https://github.com/robstoll/atrium/tree/master/samples/multiplatform)
|
You might want to have a look at the [Multiplatform sample project](https://github.com/robstoll/atrium/tree/main/samples/multiplatform)
|
||||||
as well for a quick setup.
|
as well for a quick setup.
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
We are using the API provided by the bundle module
|
We are using the API provided by the bundle module
|
||||||
[atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/master/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle)
|
[atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/main/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle)
|
||||||
in the following examples.
|
in the following examples.
|
||||||
It provides a pure fluent API for the JVM platform.
|
It provides a pure fluent API for the JVM platform.
|
||||||
Have a look at
|
Have a look at
|
||||||
[apis/differences.md](https://github.com/robstoll/atrium/tree/master/apis/differences.md)
|
[apis/differences.md](https://github.com/robstoll/atrium/tree/main/apis/differences.md)
|
||||||
to see how the infix API looks like, how they differ respectively.
|
to see how the infix API looks like, how they differ respectively.
|
||||||
|
|
||||||
## Your First Assertion
|
## Your First Assertion
|
||||||
@@ -249,7 +249,7 @@ import ch.tutteli.atrium.api.verbs.expect
|
|||||||
val x = 10
|
val x = 10
|
||||||
expect(x).toEqual(9)
|
expect(x).toEqual(9)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FirstExampleSpec.kt#L31)</sub> ↓ <sub>[Output](#ex-first)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FirstExampleSpec.kt#L31)</sub> ↓ <sub>[Output](#ex-first)</sub>
|
||||||
<a name="ex-first"></a>
|
<a name="ex-first"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 10 (kotlin.Int <1234789>)
|
expected that subject: 10 (kotlin.Int <1234789>)
|
||||||
@@ -263,7 +263,7 @@ where `◆ ...` represents a single assertion for the subject (`10` in the above
|
|||||||
In this sense the report can be read as `I expected that the subject of the assertion, which is 10, equals 9`
|
In this sense the report can be read as `I expected that the subject of the assertion, which is 10, equals 9`
|
||||||
-- and needless to say, this assertion is wrong and thus the thrown error.
|
-- and needless to say, this assertion is wrong and thus the thrown error.
|
||||||
|
|
||||||
We are using the bundle [atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/master/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle)
|
We are using the bundle [atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/main/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle)
|
||||||
and the predefined expectation verb `expect` in the examples.
|
and the predefined expectation verb `expect` in the examples.
|
||||||
Thus, the corresponding `import`s at the beginning of the file in the above example.
|
Thus, the corresponding `import`s at the beginning of the file in the above example.
|
||||||
We will omit the `import` statements in the remaining examples for brevity.
|
We will omit the `import` statements in the remaining examples for brevity.
|
||||||
@@ -280,7 +280,7 @@ The next section shows how you can define multiple assertions for the same subje
|
|||||||
// two single assertions, only first evaluated
|
// two single assertions, only first evaluated
|
||||||
expect(4 + 6).toBeLessThan(5).toBeGreaterThan(10)
|
expect(4 + 6).toBeLessThan(5).toBeGreaterThan(10)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L24)</sub> ↓ <sub>[Output](#ex-single)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L24)</sub> ↓ <sub>[Output](#ex-single)</sub>
|
||||||
<a name="ex-single"></a>
|
<a name="ex-single"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 10 (kotlin.Int <1234789>)
|
expected that subject: 10 (kotlin.Int <1234789>)
|
||||||
@@ -317,7 +317,7 @@ expect(4 + 6) {
|
|||||||
toBeGreaterThan(10)
|
toBeGreaterThan(10)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L40)</sub> ↓ <sub>[Output](#ex-group)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L40)</sub> ↓ <sub>[Output](#ex-group)</sub>
|
||||||
<a name="ex-group"></a>
|
<a name="ex-group"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 10 (kotlin.Int <1234789>)
|
expected that subject: 10 (kotlin.Int <1234789>)
|
||||||
@@ -353,7 +353,7 @@ expect {
|
|||||||
throw IllegalArgumentException("name is empty")
|
throw IllegalArgumentException("name is empty")
|
||||||
}.toThrow<IllegalStateException>()
|
}.toThrow<IllegalStateException>()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L64)</sub> ↓ <sub>[Output](#ex-toThrow1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L64)</sub> ↓ <sub>[Output](#ex-toThrow1)</sub>
|
||||||
<a name="ex-toThrow1"></a>
|
<a name="ex-toThrow1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$7$1 <1234789>)
|
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$7$1 <1234789>)
|
||||||
@@ -389,7 +389,7 @@ expect {
|
|||||||
throw IllegalArgumentException()
|
throw IllegalArgumentException()
|
||||||
}.toThrow<IllegalArgumentException>().message.toStartWith("firstName")
|
}.toThrow<IllegalArgumentException>().message.toStartWith("firstName")
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L71)</sub> ↓ <sub>[Output](#ex-toThrow2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L71)</sub> ↓ <sub>[Output](#ex-toThrow2)</sub>
|
||||||
<a name="ex-toThrow2"></a>
|
<a name="ex-toThrow2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$8$1 <1234789>)
|
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$8$1 <1234789>)
|
||||||
@@ -410,7 +410,7 @@ expect {
|
|||||||
message { toStartWith("firstName") }
|
message { toStartWith("firstName") }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L77)</sub> ↓ <sub>[Output](#ex-toThrow3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L77)</sub> ↓ <sub>[Output](#ex-toThrow3)</sub>
|
||||||
<a name="ex-toThrow3"></a>
|
<a name="ex-toThrow3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$9$1 <1234789>)
|
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$9$1 <1234789>)
|
||||||
@@ -434,7 +434,7 @@ expect {
|
|||||||
throw IllegalArgumentException("name is empty", RuntimeException("a cause"))
|
throw IllegalArgumentException("name is empty", RuntimeException("a cause"))
|
||||||
}.notToThrow()
|
}.notToThrow()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L85)</sub> ↓ <sub>[Output](#ex-notToThrow)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L85)</sub> ↓ <sub>[Output](#ex-notToThrow)</sub>
|
||||||
<a name="ex-notToThrow"></a>
|
<a name="ex-notToThrow"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$10$1 <1234789>)
|
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$10$1 <1234789>)
|
||||||
@@ -497,7 +497,7 @@ expect(myPerson)
|
|||||||
.its { fullName() } // not evaluated anymore, subject String afterwards
|
.its { fullName() } // not evaluated anymore, subject String afterwards
|
||||||
.toStartWith("rob") // not evaluated anymore
|
.toStartWith("rob") // not evaluated anymore
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L41)</sub> ↓ <sub>[Output](#ex-its-single)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L41)</sub> ↓ <sub>[Output](#ex-its-single)</sub>
|
||||||
<a name="ex-its-single"></a>
|
<a name="ex-its-single"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
||||||
@@ -543,7 +543,7 @@ Feature assertions follow the common pattern of having two overloads:
|
|||||||
its { lastName }.toEqual("Dummy")
|
its { lastName }.toEqual("Dummy")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L49)</sub> ↓ <sub>[Output](#ex-its-group)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L49)</sub> ↓ <sub>[Output](#ex-its-group)</sub>
|
||||||
<a name="ex-its-group"></a>
|
<a name="ex-its-group"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
||||||
@@ -571,7 +571,7 @@ expect(myPerson)
|
|||||||
.feature { f(it::fullName) } // not evaluated anymore, subject String afterwards
|
.feature { f(it::fullName) } // not evaluated anymore, subject String afterwards
|
||||||
.toStartWith("rob") // not evaluated anymore
|
.toStartWith("rob") // not evaluated anymore
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L63)</sub> ↓ <sub>[Output](#ex-property-methods-single)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L63)</sub> ↓ <sub>[Output](#ex-property-methods-single)</sub>
|
||||||
<a name="ex-property-methods-single"></a>
|
<a name="ex-property-methods-single"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
||||||
@@ -612,7 +612,7 @@ expect(myPerson) { // forms an assertion group block
|
|||||||
feature { f(it::lastName) }.toEqual("Dummy")
|
feature { f(it::lastName) }.toEqual("Dummy")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L71)</sub> ↓ <sub>[Output](#ex-property-methods-group)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L71)</sub> ↓ <sub>[Output](#ex-property-methods-group)</sub>
|
||||||
<a name="ex-property-methods-group"></a>
|
<a name="ex-property-methods-group"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
||||||
@@ -661,7 +661,7 @@ expect(myPerson)
|
|||||||
.toEqual("Robert aka. Stoll") // fails
|
.toEqual("Robert aka. Stoll") // fails
|
||||||
.toStartWith("llotS") // not evaluated anymore
|
.toStartWith("llotS") // not evaluated anymore
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L85)</sub> ↓ <sub>[Output](#ex-methods-args)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L85)</sub> ↓ <sub>[Output](#ex-methods-args)</sub>
|
||||||
<a name="ex-methods-args"></a>
|
<a name="ex-methods-args"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>)
|
||||||
@@ -681,7 +681,7 @@ in case you miss a shortcut.
|
|||||||
<summary>💬 Write own feature assertion functions with additional checks.</summary>
|
<summary>💬 Write own feature assertion functions with additional checks.</summary>
|
||||||
|
|
||||||
Atrium provides a feature extractor which allows making feature assertions in a safe way in case the extraction is only valid for certain subjects.
|
Atrium provides a feature extractor which allows making feature assertions in a safe way in case the extraction is only valid for certain subjects.
|
||||||
It is inter alia used for [`List.get`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13)
|
It is inter alia used for [`List.get`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ expect(myFamily)
|
|||||||
.feature("first member's name") { members.first().name } // subject narrowed to String
|
.feature("first member's name") { members.first().name } // subject narrowed to String
|
||||||
.toEqual("Peter")
|
.toEqual("Peter")
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L102)</sub> ↓ <sub>[Output](#ex-arbitrary-features)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L102)</sub> ↓ <sub>[Output](#ex-arbitrary-features)</sub>
|
||||||
<a name="ex-arbitrary-features"></a>
|
<a name="ex-arbitrary-features"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Family(members=[FamilyMember(name=Robert)]) (readme.examples.FeatureExtractorSpec$1$Family <1234789>)
|
expected that subject: Family(members=[FamilyMember(name=Robert)]) (readme.examples.FeatureExtractorSpec$1$Family <1234789>)
|
||||||
@@ -753,7 +753,7 @@ expect(listOf(1 to "a", 2 to "b")).get(10) {
|
|||||||
firstToBe(1)
|
firstToBe(1)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L118)</sub> ↓ <sub>[Output](#ex-within-assertion-functions)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L118)</sub> ↓ <sub>[Output](#ex-within-assertion-functions)</sub>
|
||||||
<a name="ex-within-assertion-functions"></a>
|
<a name="ex-within-assertion-functions"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [(1, a), (2, b)] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [(1, a), (2, b)] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -841,7 +841,7 @@ expect(x).toBeAnInstanceOf<SubType1>()
|
|||||||
.feature { f(it::number) }
|
.feature { f(it::number) }
|
||||||
.toEqual(2)
|
.toEqual(2)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L92)</sub> ↓ <sub>[Output](#ex-type-assertions-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L92)</sub> ↓ <sub>[Output](#ex-type-assertions-1)</sub>
|
||||||
<a name="ex-type-assertions-1"></a>
|
<a name="ex-type-assertions-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>)
|
expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>)
|
||||||
@@ -863,7 +863,7 @@ expect(x).toBeAnInstanceOf<SubType2> {
|
|||||||
feature { f(it::flag) }.toEqual(false)
|
feature { f(it::flag) }.toEqual(false)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L98)</sub> ↓ <sub>[Output](#ex-type-assertions-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L98)</sub> ↓ <sub>[Output](#ex-type-assertions-2)</sub>
|
||||||
<a name="ex-type-assertions-2"></a>
|
<a name="ex-type-assertions-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>)
|
expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>)
|
||||||
@@ -892,7 +892,7 @@ Let us look at the case where the subject of the assertion has a [nullable type]
|
|||||||
val slogan1: String? = "postulating assertions made easy"
|
val slogan1: String? = "postulating assertions made easy"
|
||||||
expect(slogan1).toEqual(null)
|
expect(slogan1).toEqual(null)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L106)</sub> ↓ <sub>[Output](#ex-nullable-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L106)</sub> ↓ <sub>[Output](#ex-nullable-1)</sub>
|
||||||
<a name="ex-nullable-1"></a>
|
<a name="ex-nullable-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: "postulating assertions made easy" <1234789>
|
expected that subject: "postulating assertions made easy" <1234789>
|
||||||
@@ -906,7 +906,7 @@ expected that subject: "postulating assertions made easy" <1234789>
|
|||||||
val slogan2: String? = null
|
val slogan2: String? = null
|
||||||
expect(slogan2).toEqual("postulating assertions made easy")
|
expect(slogan2).toEqual("postulating assertions made easy")
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L110)</sub> ↓ <sub>[Output](#ex-nullable-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L110)</sub> ↓ <sub>[Output](#ex-nullable-2)</sub>
|
||||||
<a name="ex-nullable-2"></a>
|
<a name="ex-nullable-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: null
|
expected that subject: null
|
||||||
@@ -927,7 +927,7 @@ expect(slogan2) // subject has type String?
|
|||||||
.notToEqualNull() // subject is narrowed to String
|
.notToEqualNull() // subject is narrowed to String
|
||||||
.toStartWith("atrium")
|
.toStartWith("atrium")
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L115)</sub> ↓ <sub>[Output](#ex-nullable-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L115)</sub> ↓ <sub>[Output](#ex-nullable-3)</sub>
|
||||||
<a name="ex-nullable-3"></a>
|
<a name="ex-nullable-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: null
|
expected that subject: null
|
||||||
@@ -944,7 +944,7 @@ one without (example above) and one with `assertionCreator`-lambda (example belo
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(slogan2).notToEqualNull { toStartWith("atrium") }
|
expect(slogan2).notToEqualNull { toStartWith("atrium") }
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L120)</sub> ↓ <sub>[Output](#ex-nullable-4)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L120)</sub> ↓ <sub>[Output](#ex-nullable-4)</sub>
|
||||||
<a name="ex-nullable-4"></a>
|
<a name="ex-nullable-4"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: null
|
expected that subject: null
|
||||||
@@ -983,7 +983,7 @@ The following sub sections show both use cases by examples.
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain(2, 3)
|
expect(listOf(1, 2, 2, 4)).toContain(2, 3)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L124)</sub> ↓ <sub>[Output](#ex-collection-short-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L124)</sub> ↓ <sub>[Output](#ex-collection-short-1)</sub>
|
||||||
<a name="ex-collection-short-1"></a>
|
<a name="ex-collection-short-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1021,7 +1021,7 @@ expect(listOf(1, 2, 2, 4)).toContain(
|
|||||||
{ toBeGreaterThan(2).toBeLessThan(4) }
|
{ toBeGreaterThan(2).toBeLessThan(4) }
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L128)</sub> ↓ <sub>[Output](#ex-collection-short-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L128)</sub> ↓ <sub>[Output](#ex-collection-short-2)</sub>
|
||||||
<a name="ex-collection-short-2"></a>
|
<a name="ex-collection-short-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1063,7 +1063,7 @@ expect(listOf(1, 2, 3, 4)).toHaveElementsAndAny {
|
|||||||
toBeLessThan(0)
|
toBeLessThan(0)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L135)</sub> ↓ <sub>[Output](#ex-collection-any)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L135)</sub> ↓ <sub>[Output](#ex-collection-any)</sub>
|
||||||
<a name="ex-collection-any"></a>
|
<a name="ex-collection-any"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1081,7 +1081,7 @@ expect(listOf(1, 2, 3, 4)).toHaveElementsAndNone {
|
|||||||
toBeGreaterThan(2)
|
toBeGreaterThan(2)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L140)</sub> ↓ <sub>[Output](#ex-collection-none)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L140)</sub> ↓ <sub>[Output](#ex-collection-none)</sub>
|
||||||
<a name="ex-collection-none"></a>
|
<a name="ex-collection-none"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1101,7 +1101,7 @@ expect(listOf(1, 2, 3, 4)).toHaveElementsAndAll {
|
|||||||
toBeGreaterThan(2)
|
toBeGreaterThan(2)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L145)</sub> ↓ <sub>[Output](#ex-collection-all)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L145)</sub> ↓ <sub>[Output](#ex-collection-all)</sub>
|
||||||
<a name="ex-collection-all"></a>
|
<a name="ex-collection-all"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1131,7 +1131,7 @@ Following on the last section we will start with an `inOrder` example:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain.inOrder.only.entries({ toBeLessThan(3) }, { toBeLessThan(2) })
|
expect(listOf(1, 2, 2, 4)).toContain.inOrder.only.entries({ toBeLessThan(3) }, { toBeLessThan(2) })
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L151)</sub> ↓ <sub>[Output](#ex-collection-builder-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L151)</sub> ↓ <sub>[Output](#ex-collection-builder-1)</sub>
|
||||||
<a name="ex-collection-builder-1"></a>
|
<a name="ex-collection-builder-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1177,7 +1177,7 @@ expect(listOf(1, 2, 2, 4)).toContainExactly(
|
|||||||
report = { showOnlyFailingIfMoreElementsThan(3) }
|
report = { showOnlyFailingIfMoreElementsThan(3) }
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L154)</sub> ↓ <sub>[Output](#ex-collection-reportOptions-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L154)</sub> ↓ <sub>[Output](#ex-collection-reportOptions-1)</sub>
|
||||||
<a name="ex-collection-reportOptions-1"></a>
|
<a name="ex-collection-reportOptions-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1208,7 +1208,7 @@ and we happily answer your question there.
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain.inOrder.only.values(1, 2, 2, 3, 4)
|
expect(listOf(1, 2, 2, 4)).toContain.inOrder.only.values(1, 2, 2, 3, 4)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L162)</sub> ↓ <sub>[Output](#ex-collection-builder-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L162)</sub> ↓ <sub>[Output](#ex-collection-builder-2)</sub>
|
||||||
<a name="ex-collection-builder-2"></a>
|
<a name="ex-collection-builder-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1233,7 +1233,7 @@ expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.atLeast(1).butAtMost(2).entries({ toBeLessThan(3) })
|
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.atLeast(1).butAtMost(2).entries({ toBeLessThan(3) })
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L165)</sub> ↓ <sub>[Output](#ex-collection-builder-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L165)</sub> ↓ <sub>[Output](#ex-collection-builder-3)</sub>
|
||||||
<a name="ex-collection-builder-3"></a>
|
<a name="ex-collection-builder-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1250,7 +1250,7 @@ expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.only.values(1, 2, 3, 4)
|
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.only.values(1, 2, 3, 4)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L168)</sub> ↓ <sub>[Output](#ex-collection-builder-4)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L168)</sub> ↓ <sub>[Output](#ex-collection-builder-4)</sub>
|
||||||
<a name="ex-collection-builder-4"></a>
|
<a name="ex-collection-builder-4"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1269,7 +1269,7 @@ expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.only.values(4, 3, 2, 2, 1)
|
expect(listOf(1, 2, 2, 4)).toContain.inAnyOrder.only.values(4, 3, 2, 2, 1)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L171)</sub> ↓ <sub>[Output](#ex-collection-builder-5)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L171)</sub> ↓ <sub>[Output](#ex-collection-builder-5)</sub>
|
||||||
<a name="ex-collection-builder-5"></a>
|
<a name="ex-collection-builder-5"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>)
|
||||||
@@ -1299,7 +1299,7 @@ and more [Sophisticated Assertion Builder](#sophisticated-assertion-builders-1)
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(mapOf("a" to 1, "b" to 2)).toContain("c" to 2, "a" to 1, "b" to 1)
|
expect(mapOf("a" to 1, "b" to 2)).toContain("c" to 2, "a" to 1, "b" to 1)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L175)</sub> ↓ <sub>[Output](#ex-map-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L175)</sub> ↓ <sub>[Output](#ex-map-1)</sub>
|
||||||
<a name="ex-map-1"></a>
|
<a name="ex-map-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1323,7 +1323,7 @@ expect(mapOf("a" to 1, "b" to 2)).toContain(
|
|||||||
KeyValue("b") { toBeLessThan(2) }
|
KeyValue("b") { toBeLessThan(2) }
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L178)</sub> ↓ <sub>[Output](#ex-map-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L178)</sub> ↓ <sub>[Output](#ex-map-2)</sub>
|
||||||
<a name="ex-map-2"></a>
|
<a name="ex-map-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1345,7 +1345,7 @@ Again both overloads are provided, one for key-value `Pair`s:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(mapOf("a" to 1, "b" to 2)).toContainOnly("b" to 2)
|
expect(mapOf("a" to 1, "b" to 2)).toContainOnly("b" to 2)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L186)</sub> ↓ <sub>[Output](#ex-map-only-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L186)</sub> ↓ <sub>[Output](#ex-map-only-1)</sub>
|
||||||
<a name="ex-map-only-1"></a>
|
<a name="ex-map-only-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1370,7 +1370,7 @@ expect(mapOf("a" to 1, "b" to 2)).toContainOnly(
|
|||||||
KeyValue("b") { toBeLessThan(2) }
|
KeyValue("b") { toBeLessThan(2) }
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L189)</sub> ↓ <sub>[Output](#ex-map-only-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L189)</sub> ↓ <sub>[Output](#ex-map-only-2)</sub>
|
||||||
<a name="ex-map-only-2"></a>
|
<a name="ex-map-only-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1398,7 +1398,7 @@ again provide two overloads, one expecting key-value `Pair`s:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(mapOf("a" to 1, "b" to 2)).toContain.inOrder.only.entries("b" to 2, "a" to 1)
|
expect(mapOf("a" to 1, "b" to 2)).toContain.inOrder.only.entries("b" to 2, "a" to 1)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L197)</sub> ↓ <sub>[Output](#ex-map-builder-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L197)</sub> ↓ <sub>[Output](#ex-map-builder-1)</sub>
|
||||||
<a name="ex-map-builder-1"></a>
|
<a name="ex-map-builder-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1425,7 +1425,7 @@ expect(mapOf("a" to 1, "b" to 2)).toContain.inOrder.only.entries(
|
|||||||
KeyValue("a") { toBeLessThan(2) },
|
KeyValue("a") { toBeLessThan(2) },
|
||||||
KeyValue("b") { toBeLessThan(2) })
|
KeyValue("b") { toBeLessThan(2) })
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L200)</sub> ↓ <sub>[Output](#ex-map-builder-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L200)</sub> ↓ <sub>[Output](#ex-map-builder-2)</sub>
|
||||||
<a name="ex-map-builder-2"></a>
|
<a name="ex-map-builder-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1462,7 +1462,7 @@ expect(mapOf("bernstein" to bernstein))
|
|||||||
feature { f(it::firstName) }.toEqual("Albert")
|
feature { f(it::firstName) }.toEqual("Albert")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L210)</sub> ↓ <sub>[Output](#ex-map-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L210)</sub> ↓ <sub>[Output](#ex-map-3)</sub>
|
||||||
<a name="ex-map-3"></a>
|
<a name="ex-map-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {bernstein=Person(firstName=Leonard, lastName=Bernstein, age=50)} (java.util.Collections.SingletonMap <1234789>)
|
expected that subject: {bernstein=Person(firstName=Leonard, lastName=Bernstein, age=50)} (java.util.Collections.SingletonMap <1234789>)
|
||||||
@@ -1482,7 +1482,7 @@ expect(mapOf("a" to 1, "b" to 2)) {
|
|||||||
values { toHaveElementsAndNone { toBeGreaterThan(1) } }
|
values { toHaveElementsAndNone { toBeGreaterThan(1) } }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L222)</sub> ↓ <sub>[Output](#ex-map-4)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L222)</sub> ↓ <sub>[Output](#ex-map-4)</sub>
|
||||||
<a name="ex-map-4"></a>
|
<a name="ex-map-4"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1518,7 +1518,7 @@ expect(linkedMapOf("a" to 1, "b" to 2)).asEntries().toContain.inOrder.only.entri
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L228)</sub> ↓ <sub>[Output](#ex-map-5)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L228)</sub> ↓ <sub>[Output](#ex-map-5)</sub>
|
||||||
<a name="ex-map-5"></a>
|
<a name="ex-map-5"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>)
|
||||||
@@ -1551,7 +1551,7 @@ For example, `exists` will explain which entry was the first one missing:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(Paths.get("/usr/bin/noprogram")).toExist()
|
expect(Paths.get("/usr/bin/noprogram")).toExist()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L37)</sub> ↓ <sub>[Output](#ex-path-exists)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L37)</sub> ↓ <sub>[Output](#ex-path-exists)</sub>
|
||||||
<a name="ex-path-exists"></a>
|
<a name="ex-path-exists"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: /usr/bin/noprogram (sun.nio.fs.UnixPath <1234789>)
|
expected that subject: /usr/bin/noprogram (sun.nio.fs.UnixPath <1234789>)
|
||||||
@@ -1567,7 +1567,7 @@ Atrium will give details about why something cannot be accessed, for example whe
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(Paths.get("/root/.ssh/config")).toBeWritable()
|
expect(Paths.get("/root/.ssh/config")).toBeWritable()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L41)</sub> ↓ <sub>[Output](#ex-path-writable)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L41)</sub> ↓ <sub>[Output](#ex-path-writable)</sub>
|
||||||
<a name="ex-path-writable"></a>
|
<a name="ex-path-writable"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: /root/.ssh/config (sun.nio.fs.UnixPath <1234789>)
|
expected that subject: /root/.ssh/config (sun.nio.fs.UnixPath <1234789>)
|
||||||
@@ -1590,7 +1590,7 @@ val filePointer = Files.createSymbolicLink(directory.resolve("directory"), file)
|
|||||||
|
|
||||||
expect(filePointer.resolve("subfolder/file")).toBeARegularFile()
|
expect(filePointer.resolve("subfolder/file")).toBeARegularFile()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L46)</sub> ↓ <sub>[Output](#ex-path-symlink-and-parent-not-folder)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L46)</sub> ↓ <sub>[Output](#ex-path-symlink-and-parent-not-folder)</sub>
|
||||||
<a name="ex-path-symlink-and-parent-not-folder"></a>
|
<a name="ex-path-symlink-and-parent-not-folder"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: /tmp/atrium-path/directory/subfolder/file (sun.nio.fs.UnixPath <1234789>)
|
expected that subject: /tmp/atrium-path/directory/subfolder/file (sun.nio.fs.UnixPath <1234789>)
|
||||||
@@ -1614,7 +1614,7 @@ expect("filename?")
|
|||||||
notToContain("?")
|
notToContain("?")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L238)</sub> ↓ <sub>[Output](#ex-because-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L238)</sub> ↓ <sub>[Output](#ex-because-1)</sub>
|
||||||
<a name="ex-because-1"></a>
|
<a name="ex-because-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: "filename?" <1234789>
|
expected that subject: "filename?" <1234789>
|
||||||
@@ -1669,7 +1669,7 @@ expect("calling myFun with...") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L35)</sub> ↓ <sub>[Output](#ex-data-driven-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L35)</sub> ↓ <sub>[Output](#ex-data-driven-1)</sub>
|
||||||
<a name="ex-data-driven-1"></a>
|
<a name="ex-data-driven-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: "calling myFun with..." <1234789>
|
expected that subject: "calling myFun with..." <1234789>
|
||||||
@@ -1704,7 +1704,7 @@ expect("calling myFun with ...") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L49)</sub> ↓ <sub>[Output](#ex-data-driven-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L49)</sub> ↓ <sub>[Output](#ex-data-driven-2)</sub>
|
||||||
<a name="ex-data-driven-2"></a>
|
<a name="ex-data-driven-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: "calling myFun with ..." <1234789>
|
expected that subject: "calling myFun with ..." <1234789>
|
||||||
@@ -1745,7 +1745,7 @@ expect("calling myNullableFun with ...") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L67)</sub> ↓ <sub>[Output](#ex-data-driven-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L67)</sub> ↓ <sub>[Output](#ex-data-driven-3)</sub>
|
||||||
<a name="ex-data-driven-3"></a>
|
<a name="ex-data-driven-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: "calling myNullableFun with ..." <1234789>
|
expected that subject: "calling myNullableFun with ..." <1234789>
|
||||||
@@ -1762,21 +1762,21 @@ expected that subject: "calling myNullableFun with ..." <1234789>
|
|||||||
|
|
||||||
Atrium supports further assertion builders (e.g, for `CharSequence`)
|
Atrium supports further assertion builders (e.g, for `CharSequence`)
|
||||||
as well as assertion functions which have not been shown in the examples.
|
as well as assertion functions which have not been shown in the examples.
|
||||||
Have a look at [apis/differences.md](https://github.com/robstoll/atrium/tree/master/apis/differences.md) for a few more examples.
|
Have a look at [apis/differences.md](https://github.com/robstoll/atrium/tree/main/apis/differences.md) for a few more examples.
|
||||||
This site contains also a list of all APIs with links to their assertion function catalogs.
|
This site contains also a list of all APIs with links to their assertion function catalogs.
|
||||||
|
|
||||||
You can also have a look at the
|
You can also have a look at the
|
||||||
[specifications](https://github.com/robstoll/atrium/tree/master/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs)
|
[specifications](https://github.com/robstoll/atrium/tree/main/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs)
|
||||||
for more examples.
|
for more examples.
|
||||||
|
|
||||||
## Sample Projects
|
## Sample Projects
|
||||||
|
|
||||||
Have a look into the [samples](https://github.com/robstoll/atrium/tree/master/samples)
|
Have a look into the [samples](https://github.com/robstoll/atrium/tree/main/samples)
|
||||||
folder, it currently contains sample projects for
|
folder, it currently contains sample projects for
|
||||||
- [jvm gradle](https://github.com/robstoll/atrium/tree/master/samples/jvm/)
|
- [jvm gradle](https://github.com/robstoll/atrium/tree/main/samples/jvm/)
|
||||||
- [maven](https://github.com/robstoll/atrium/tree/master/samples/maven/)
|
- [maven](https://github.com/robstoll/atrium/tree/main/samples/maven/)
|
||||||
- [js](https://github.com/robstoll/atrium/tree/master/samples/js/)
|
- [js](https://github.com/robstoll/atrium/tree/main/samples/js/)
|
||||||
- [multiplatform project](https://github.com/robstoll/atrium/tree/master/samples/multiplatform/)
|
- [multiplatform project](https://github.com/robstoll/atrium/tree/main/samples/multiplatform/)
|
||||||
|
|
||||||
Are you using a different runner? A PR would be appreciated 😊.
|
Are you using a different runner? A PR would be appreciated 😊.
|
||||||
|
|
||||||
@@ -1890,7 +1890,7 @@ expect {
|
|||||||
}
|
}
|
||||||
}.toThrow<IllegalStateException> { messageToContain("no no no") }
|
}.toThrow<IllegalStateException> { messageToContain("no no no") }
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L251)</sub> ↓ <sub>[Output](#ex-add-info-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L251)</sub> ↓ <sub>[Output](#ex-add-info-3)</sub>
|
||||||
<a name="ex-add-info-3"></a>
|
<a name="ex-add-info-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$40$1 <1234789>)
|
expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$40$1 <1234789>)
|
||||||
@@ -1932,7 +1932,7 @@ then Atrium reminds us of the possible pitfall. For instance:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(BigDecimal.TEN).toEqualIncludingScale(BigDecimal("10.0"))
|
expect(BigDecimal.TEN).toEqualIncludingScale(BigDecimal("10.0"))
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L261)</sub> ↓ <sub>[Output](#ex-pitfall-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L261)</sub> ↓ <sub>[Output](#ex-pitfall-1)</sub>
|
||||||
<a name="ex-pitfall-1"></a>
|
<a name="ex-pitfall-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 10 (java.math.BigDecimal <1234789>)
|
expected that subject: 10 (java.math.BigDecimal <1234789>)
|
||||||
@@ -1950,7 +1950,7 @@ For instance:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(listOf(1)).get(0) {}
|
expect(listOf(1)).get(0) {}
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L264)</sub> ↓ <sub>[Output](#ex-pitfall-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L264)</sub> ↓ <sub>[Output](#ex-pitfall-2)</sub>
|
||||||
<a name="ex-pitfall-2"></a>
|
<a name="ex-pitfall-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: [1] (java.util.Collections.SingletonList <1234789>)
|
expected that subject: [1] (java.util.Collections.SingletonList <1234789>)
|
||||||
@@ -2029,7 +2029,7 @@ and its usage:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(12).toBeAMultipleOf(5)
|
expect(12).toBeAMultipleOf(5)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L44)</sub> ↓ <sub>[Output](#ex-own-boolean-1)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L44)</sub> ↓ <sub>[Output](#ex-own-boolean-1)</sub>
|
||||||
<a name="ex-own-boolean-1"></a>
|
<a name="ex-own-boolean-1"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 12 (kotlin.Int <1234789>)
|
expected that subject: 12 (kotlin.Int <1234789>)
|
||||||
@@ -2081,7 +2081,7 @@ Its usage looks then as follows:
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(13).toBeEven()
|
expect(13).toBeEven()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L57)</sub> ↓ <sub>[Output](#ex-own-boolean-2)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L57)</sub> ↓ <sub>[Output](#ex-own-boolean-2)</sub>
|
||||||
<a name="ex-own-boolean-2"></a>
|
<a name="ex-own-boolean-2"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: 13 (kotlin.Int <1234789>)
|
expected that subject: 13 (kotlin.Int <1234789>)
|
||||||
@@ -2182,7 +2182,7 @@ Its usage is then as follows:
|
|||||||
expect(Person("Susanne", "Whitley", 43, listOf()))
|
expect(Person("Susanne", "Whitley", 43, listOf()))
|
||||||
.toHaveNumberOfChildren(2)
|
.toHaveNumberOfChildren(2)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L74)</sub> ↓ <sub>[Output](#ex-own-compose-3)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L74)</sub> ↓ <sub>[Output](#ex-own-compose-3)</sub>
|
||||||
<a name="ex-own-compose-3"></a>
|
<a name="ex-own-compose-3"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>)
|
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>)
|
||||||
@@ -2218,7 +2218,7 @@ I.e. it fails for a `Person` with 0 children, because such a person does not hav
|
|||||||
expect(Person("Susanne", "Whitley", 43, listOf()))
|
expect(Person("Susanne", "Whitley", 43, listOf()))
|
||||||
.toHaveAdultChildren()
|
.toHaveAdultChildren()
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L91)</sub> ↓ <sub>[Output](#ex-own-compose-4)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L91)</sub> ↓ <sub>[Output](#ex-own-compose-4)</sub>
|
||||||
<a name="ex-own-compose-4"></a>
|
<a name="ex-own-compose-4"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>)
|
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>)
|
||||||
@@ -2268,7 +2268,7 @@ expect(Person("Susanne", "Whitley", 43, listOf(Person("Petra", "Whitley", 12, li
|
|||||||
.children // using the val -> subsequent assertions are about children and fail fast
|
.children // using the val -> subsequent assertions are about children and fail fast
|
||||||
.toHaveSize(2)
|
.toHaveSize(2)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L101)</sub> ↓ <sub>[Output](#ex-own-compose-5)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L101)</sub> ↓ <sub>[Output](#ex-own-compose-5)</sub>
|
||||||
<a name="ex-own-compose-5"></a>
|
<a name="ex-own-compose-5"></a>
|
||||||
```text
|
```text
|
||||||
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[Person(firstName=Petra, lastName=Whitley, age=12, children=[])]) (readme.examples.Person <1234789>)
|
expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[Person(firstName=Petra, lastName=Whitley, age=12, children=[])]) (readme.examples.Person <1234789>)
|
||||||
@@ -2340,23 +2340,23 @@ it suffices to create an extension function for `ArgumentMapperBuilder`.
|
|||||||
Yet, sometimes we would like to create functions which have a better error reporting than the one we get
|
Yet, sometimes we would like to create functions which have a better error reporting than the one we get
|
||||||
when we compose assertion functions.
|
when we compose assertion functions.
|
||||||
|
|
||||||
[`_logic`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/logic.kt#L21)
|
[`_logic`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/logic.kt#L21)
|
||||||
is the entry point to `AssertionContainer` which is the equivalent of `Expect` but on a lower level.
|
is the entry point to `AssertionContainer` which is the equivalent of `Expect` but on a lower level.
|
||||||
|
|
||||||
Following a quick overview what extension methods could be useful:
|
Following a quick overview what extension methods could be useful:
|
||||||
- all assertion functions on the logic level (what you have seen in [Compose-assertion-functions](#compose-assertion-functions)
|
- all assertion functions on the logic level (what you have seen in [Compose-assertion-functions](#compose-assertion-functions)
|
||||||
was the API level) so that you can reuse and compose them in other ways.
|
was the API level) so that you can reuse and compose them in other ways.
|
||||||
- `changeSubject` which allows to change the subject either:
|
- `changeSubject` which allows to change the subject either:
|
||||||
- `unreported`; meaning it does not show up in reporting (e.g. `Expect<Array<out T>>.asList()` uses it, see [arrayAssertions](https://github.com/robstoll/atrium/tree/master/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/arrayAssertions.kt#L19))
|
- `unreported`; meaning it does not show up in reporting (e.g. `Expect<Array<out T>>.asList()` uses it, see [arrayAssertions](https://github.com/robstoll/atrium/tree/main/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/arrayAssertions.kt#L19))
|
||||||
- reported, using `reportBuilder`; meaning a subject transformation which is shown in reporting as it incorporates a transformation (e.g. `toBeA` uses it, see [AnyAssertions](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultAnyAssertions.kt#L52))
|
- reported, using `reportBuilder`; meaning a subject transformation which is shown in reporting as it incorporates a transformation (e.g. `toBeA` uses it, see [AnyAssertions](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultAnyAssertions.kt#L52))
|
||||||
- `collect` which allows to collect assertions - especially helpful in composing assertions (see [mapAssertions](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultMapAssertions.kt#L49))
|
- `collect` which allows to collect assertions - especially helpful in composing assertions (see [mapAssertions](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultMapAssertions.kt#L49))
|
||||||
- `extractFeature` for feature assertions which are not always save to extract (see [`List.get`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13))
|
- `extractFeature` for feature assertions which are not always save to extract (see [`List.get`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13))
|
||||||
|
|
||||||
Besides, the `assertionBuilder` allows to create different kinds of assertions
|
Besides, the `assertionBuilder` allows to create different kinds of assertions
|
||||||
(see [AssertionBuilder](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.assertions.builders/-assertion-builder/index.html) for more information)
|
(see [AssertionBuilder](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.assertions.builders/-assertion-builder/index.html) for more information)
|
||||||
which can be used to create very specific assertion functions.
|
which can be used to create very specific assertion functions.
|
||||||
|
|
||||||
You can find an example in [floatingPointAssertions](https://github.com/robstoll/atrium/blob/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultFloatingPointAssertions.kt#L72)
|
You can find an example in [floatingPointAssertions](https://github.com/robstoll/atrium/blob/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultFloatingPointAssertions.kt#L72)
|
||||||
which makes use of explanatory assertions as well as providing a failure hint.
|
which makes use of explanatory assertions as well as providing a failure hint.
|
||||||
|
|
||||||
Unfortunately we do not have the time to cover all cases, so let us know if you want to know more
|
Unfortunately we do not have the time to cover all cases, so let us know if you want to know more
|
||||||
@@ -2378,7 +2378,7 @@ Atrium offers the expectation verb `expect` out of the box.
|
|||||||
|
|
||||||
You can also define your own expectation verb if `expect` does not suite you or in case you want to change some default implementation.
|
You can also define your own expectation verb if `expect` does not suite you or in case you want to change some default implementation.
|
||||||
In order to create an own expectation verb it is sufficient to:
|
In order to create an own expectation verb it is sufficient to:
|
||||||
1. Copy the file content of [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/master/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt)
|
1. Copy the file content of [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/main/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt)
|
||||||
2. Create your own atriumVerbs.kt and paste the previously copied content
|
2. Create your own atriumVerbs.kt and paste the previously copied content
|
||||||
-- notice that you can also use a `String` for the expectation verb in case you do not care about [Internationalization](#internationalization-1)
|
-- notice that you can also use a `String` for the expectation verb in case you do not care about [Internationalization](#internationalization-1)
|
||||||
3. Adjust package name and `import`s and rename `expect` as desired (you can also leave it that way of course).
|
3. Adjust package name and `import`s and rename `expect` as desired (you can also leave it that way of course).
|
||||||
@@ -2416,7 +2416,7 @@ What are the drawbacks:
|
|||||||
## Use own Components
|
## Use own Components
|
||||||
|
|
||||||
Replacing existing components with your own (or third-party) components can be done when specifying an own expectation verb
|
Replacing existing components with your own (or third-party) components can be done when specifying an own expectation verb
|
||||||
via `withOptions`. See for instance [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/master/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt#L31)
|
via `withOptions`. See for instance [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/main/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt#L31)
|
||||||
which is used internally of Atrium in tests and uses a different `AtriumErrorAdjuster`.
|
which is used internally of Atrium in tests and uses a different `AtriumErrorAdjuster`.
|
||||||
|
|
||||||
Another example, say you prefer multi-line reporting over single-line reporting,
|
Another example, say you prefer multi-line reporting over single-line reporting,
|
||||||
@@ -2449,7 +2449,7 @@ Following an example using the expectation verb
|
|||||||
```kotlin
|
```kotlin
|
||||||
expect(10).toEqual(9)
|
expect(10).toEqual(9)
|
||||||
```
|
```
|
||||||
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationVerbSpec.kt#L51)</sub> ↓ <sub>[Output](#ex-own-expectation-verb)</sub>
|
↑ <sub>[Example](https://github.com/robstoll/atrium/tree/main/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationVerbSpec.kt#L51)</sub> ↓ <sub>[Output](#ex-own-expectation-verb)</sub>
|
||||||
<a name="ex-own-expectation-verb"></a>
|
<a name="ex-own-expectation-verb"></a>
|
||||||
```text
|
```text
|
||||||
expected the subject:
|
expected the subject:
|
||||||
@@ -2469,7 +2469,7 @@ You prefer another reporting style but Atrium does not yet support it?
|
|||||||
Please let us know it by [writing a feature request](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]).
|
Please let us know it by [writing a feature request](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]).
|
||||||
|
|
||||||
There are more options to choose from. Take a look at the
|
There are more options to choose from. Take a look at the
|
||||||
[DefaultComponentFactoryContainer](https://github.com/robstoll/atrium/tree/master/core/atrium-core-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt#L121)
|
[DefaultComponentFactoryContainer](https://github.com/robstoll/atrium/tree/main/core/atrium-core-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt#L121)
|
||||||
to see the default configuration.
|
to see the default configuration.
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
@@ -2505,10 +2505,10 @@ enum class DescriptionIntAssertion(override val value: String) : StringBasedTran
|
|||||||
Typically, you would put `DescriptionIntAssertion` into an own module (jar)
|
Typically, you would put `DescriptionIntAssertion` into an own module (jar)
|
||||||
so that it could be replaced (with zero performance cost) by another language representation.
|
so that it could be replaced (with zero performance cost) by another language representation.
|
||||||
For instance,
|
For instance,
|
||||||
[atrium-fluent-en_GB-common](https://github.com/robstoll/atrium/tree/master/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle)
|
[atrium-fluent-en_GB-common](https://github.com/robstoll/atrium/tree/main/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle)
|
||||||
uses `atrium-translations-en_GB-common` whereas
|
uses `atrium-translations-en_GB-common` whereas
|
||||||
tests of
|
tests of
|
||||||
[atrium-infix_en_GB-common](https://github.com/robstoll/atrium/tree/master/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle)
|
[atrium-infix_en_GB-common](https://github.com/robstoll/atrium/tree/main/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle)
|
||||||
uses `atrium-translations-de_CH-common`.
|
uses `atrium-translations-de_CH-common`.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@@ -2627,11 +2627,11 @@ However, this is more intended for advanced user with special requirements.
|
|||||||
Atrium provides bundle modules which bundle API, logic, core, translation as well as predefined expectation verbs,
|
Atrium provides bundle modules which bundle API, logic, core, translation as well as predefined expectation verbs,
|
||||||
so that you just have to have a dependency on one of those bundles (kind a bit like a BOM pom in the maven world):
|
so that you just have to have a dependency on one of those bundles (kind a bit like a BOM pom in the maven world):
|
||||||
|
|
||||||
- [atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/master/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle)
|
- [atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/main/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle)
|
||||||
- [atrium-infix-en_GB](https://github.com/robstoll/atrium/tree/master/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle)
|
- [atrium-infix-en_GB](https://github.com/robstoll/atrium/tree/main/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle)
|
||||||
|
|
||||||
Have a look at
|
Have a look at
|
||||||
[apis/differences.md](https://github.com/robstoll/atrium/tree/master/apis/differences.md)
|
[apis/differences.md](https://github.com/robstoll/atrium/tree/main/apis/differences.md)
|
||||||
for more information and to see how the API styles differ.
|
for more information and to see how the API styles differ.
|
||||||
|
|
||||||
|
|
||||||
@@ -2646,15 +2646,15 @@ Therefore, you want to turn the platform type into the nullable version.
|
|||||||
|
|
||||||
You need to use a cast to do this. But depending on your return type this might be cumbersome especially if you deal with type parameters.
|
You need to use a cast to do this. But depending on your return type this might be cumbersome especially if you deal with type parameters.
|
||||||
Thus, Atrium provides the following functions to ease dealing with Java Code at least for some standard cases:
|
Thus, Atrium provides the following functions to ease dealing with Java Code at least for some standard cases:
|
||||||
- [`nullable`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L19)
|
- [`nullable`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L19)
|
||||||
turns a type into a nullable type.
|
turns a type into a nullable type.
|
||||||
- [`nullableContainer`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L40)
|
- [`nullableContainer`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L40)
|
||||||
turns an `Iterable` into an iterable with nullable element type, likewise it does the same for `Array`.
|
turns an `Iterable` into an iterable with nullable element type, likewise it does the same for `Array`.
|
||||||
- [`nullableKeyMap`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L66)
|
- [`nullableKeyMap`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L66)
|
||||||
turns a `Map` into a map with a nullable key type.
|
turns a `Map` into a map with a nullable key type.
|
||||||
- [`nullableValueMap`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L79)
|
- [`nullableValueMap`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L79)
|
||||||
turns a `Map` into a map with a nullable value type.
|
turns a `Map` into a map with a nullable value type.
|
||||||
- [`nullableKeyValueMap`](https://github.com/robstoll/atrium/tree/master/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L92)
|
- [`nullableKeyValueMap`](https://github.com/robstoll/atrium/tree/main/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L92)
|
||||||
turns a `Map` into a map with a nullable key and nullable value type.
|
turns a `Map` into a map with a nullable key and nullable value type.
|
||||||
|
|
||||||
|
|
||||||
@@ -2747,7 +2747,7 @@ You are more than welcome to contribute as well:
|
|||||||
if you would like to code (ping us on [Slack](https://kotlinlang.slack.com/messages/C887ZKGCQ) if there are not any).
|
if you would like to code (ping us on [Slack](https://kotlinlang.slack.com/messages/C887ZKGCQ) if there are not any).
|
||||||
|
|
||||||
Please have a look at
|
Please have a look at
|
||||||
[CONTRIBUTING.md](https://github.com/robstoll/atrium/tree/master/.github/CONTRIBUTING.md)
|
[CONTRIBUTING.md](https://github.com/robstoll/atrium/tree/main/.github/CONTRIBUTING.md)
|
||||||
for further suggestions and guidelines.
|
for further suggestions and guidelines.
|
||||||
|
|
||||||
# Sponsors
|
# Sponsors
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ The links point to the KDoc of their included API where you find an overview of
|
|||||||
----
|
----
|
||||||
|
|
||||||
Following an excerpt of a build.gradle file which uses twit APIs (see
|
Following an excerpt of a build.gradle file which uses twit APIs (see
|
||||||
[README#Installation](https://github.com/robstoll/atrium/tree/master/README.md#installation)
|
[README#Installation](https://github.com/robstoll/atrium/tree/main/README.md#installation)
|
||||||
for the rest):
|
for the rest):
|
||||||
```
|
```
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
28
build.gradle
28
build.gradle
@@ -59,7 +59,7 @@ buildscript {
|
|||||||
ghPages_version = rootProject.version
|
ghPages_version = rootProject.version
|
||||||
srcKotlin = 'src/main/kotlin'
|
srcKotlin = 'src/main/kotlin'
|
||||||
github_url = "https://github.com/robstoll/${rootProject.name}"
|
github_url = "https://github.com/robstoll/${rootProject.name}"
|
||||||
dokka_sourceMapping = "tree/master"
|
dokka_sourceMapping = "tree/main"
|
||||||
|
|
||||||
|
|
||||||
toolProjects = toolProjectsFun
|
toolProjects = toolProjectsFun
|
||||||
@@ -422,7 +422,7 @@ nexusPublishing {
|
|||||||
Release & deploy a commit
|
Release & deploy a commit
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
1. update master:
|
1. update main:
|
||||||
|
|
||||||
Either use the following commands or the manual steps below
|
Either use the following commands or the manual steps below
|
||||||
|
|
||||||
@@ -430,15 +430,15 @@ export ATRIUM_PREVIOUS_VERSION=0.17.0-RC1
|
|||||||
export ATRIUM_VERSION=0.17.0
|
export ATRIUM_VERSION=0.17.0
|
||||||
find ./ -name "*.md" | xargs perl -0777 -i \
|
find ./ -name "*.md" | xargs perl -0777 -i \
|
||||||
-pe "s@$ATRIUM_PREVIOUS_VERSION@$ATRIUM_VERSION@g;" \
|
-pe "s@$ATRIUM_PREVIOUS_VERSION@$ATRIUM_VERSION@g;" \
|
||||||
-pe "s@tree/master@tree/v$ATRIUM_VERSION@g;" \
|
-pe "s@tree/main@tree/v$ATRIUM_VERSION@g;" \
|
||||||
-pe "s@latest#/doc@$ATRIUM_VERSION/doc@g;"
|
-pe "s@latest#/doc@$ATRIUM_VERSION/doc@g;"
|
||||||
perl -0777 -i \
|
perl -0777 -i \
|
||||||
-pe "s@$ATRIUM_PREVIOUS_VERSION@$ATRIUM_VERSION@g;" \
|
-pe "s@$ATRIUM_PREVIOUS_VERSION@$ATRIUM_VERSION@g;" \
|
||||||
-pe "s@dokka_sourceMapping = \"tree/master\"@dokka_sourceMapping = \"tree/v$ATRIUM_VERSION\"@;" \
|
-pe "s@dokka_sourceMapping = \"tree/main\"@dokka_sourceMapping = \"tree/v$ATRIUM_VERSION\"@;" \
|
||||||
-pe "s/rootProject.version = '$ATRIUM_VERSION-SNAPSHOT'/rootProject.version = '$ATRIUM_VERSION'/;" \
|
-pe "s/rootProject.version = '$ATRIUM_VERSION-SNAPSHOT'/rootProject.version = '$ATRIUM_VERSION'/;" \
|
||||||
./build.gradle
|
./build.gradle
|
||||||
perl -0777 -i \
|
perl -0777 -i \
|
||||||
-pe 's/(<!-- for master -->\n)\n([\S\s]*?)(\n<!-- for a specific release -->\n)<!--\n([\S\s]*?)-->\n(\n# <img)/$1<!--\n$2-->$3\n$4\n$5/;' \
|
-pe 's/(<!-- for main -->\n)\n([\S\s]*?)(\n<!-- for a specific release -->\n)<!--\n([\S\s]*?)-->\n(\n# <img)/$1<!--\n$2-->$3\n$4\n$5/;' \
|
||||||
-pe 's/(---\n❗ You are taking[^-]*?---)/<!$1>/;' \
|
-pe 's/(---\n❗ You are taking[^-]*?---)/<!$1>/;' \
|
||||||
./README.md
|
./README.md
|
||||||
git commit -a -m "v$ATRIUM_VERSION"
|
git commit -a -m "v$ATRIUM_VERSION"
|
||||||
@@ -450,10 +450,10 @@ alternatively the manual steps:
|
|||||||
|
|
||||||
a) change rootProject.version in build.gradle to X.Y.Z
|
a) change rootProject.version in build.gradle to X.Y.Z
|
||||||
b) search for old version in README.md and replace with new
|
b) search for old version in README.md and replace with new
|
||||||
c) search for `tree/master` in all .md files and replace it with `tree/vX.Y.Z`
|
c) search for `tree/main` in all .md files and replace it with `tree/vX.Y.Z`
|
||||||
d) adjust dokka_sourceMapping from `tree/master` to tree/vX.Y.Z
|
d) adjust dokka_sourceMapping from `tree/main` to tree/vX.Y.Z
|
||||||
e) search for `latest#/doc` in all .md files and replace with `X.Y.Z/doc`
|
e) search for `latest#/doc` in all .md files and replace with `X.Y.Z/doc`
|
||||||
f) use the release badges in README (comment out the ones for master and uncomment the ones for the release)
|
f) use the release badges in README (comment out the ones for main and uncomment the ones for the release)
|
||||||
g) comment out the warning in README.md about taking a sneak peak
|
g) comment out the warning in README.md about taking a sneak peak
|
||||||
h) commit & push (modified CONTRIBUTING.md, differences.md, build.gradle and README.md)
|
h) commit & push (modified CONTRIBUTING.md, differences.md, build.gradle and README.md)
|
||||||
|
|
||||||
@@ -502,25 +502,25 @@ alternatively the manual steps:
|
|||||||
|
|
||||||
Prepare next dev cycle
|
Prepare next dev cycle
|
||||||
-----------------------
|
-----------------------
|
||||||
1. update master:
|
1. update main:
|
||||||
|
|
||||||
Either use the following commands or the manual steps below
|
Either use the following commands or the manual steps below
|
||||||
|
|
||||||
export ATRIUM_VERSION=0.17.0-RC1
|
export ATRIUM_VERSION=0.17.0-RC1
|
||||||
export ATRIUM_NEXT_VERSION=0.17.0
|
export ATRIUM_NEXT_VERSION=0.17.0
|
||||||
find ./ -name "*.md" | xargs perl -0777 -i \
|
find ./ -name "*.md" | xargs perl -0777 -i \
|
||||||
-pe "s@tree/v$ATRIUM_VERSION@tree/master@g;" \
|
-pe "s@tree/v$ATRIUM_VERSION@tree/main@g;" \
|
||||||
-pe "s@$ATRIUM_VERSION/doc@latest#/doc@g;" \
|
-pe "s@$ATRIUM_VERSION/doc@latest#/doc@g;" \
|
||||||
-pe "s/add \\\`\@since $ATRIUM_VERSION\\\` \(adapt to current/add \\\`\@since $ATRIUM_NEXT_VERSION\\\` \(adapt to current/g;"
|
-pe "s/add \\\`\@since $ATRIUM_VERSION\\\` \(adapt to current/add \\\`\@since $ATRIUM_NEXT_VERSION\\\` \(adapt to current/g;"
|
||||||
perl -0777 -i \
|
perl -0777 -i \
|
||||||
-pe "s@dokka_sourceMapping = \"tree/v$ATRIUM_VERSION\"@dokka_sourceMapping = \"tree/master\"@;" \
|
-pe "s@dokka_sourceMapping = \"tree/v$ATRIUM_VERSION\"@dokka_sourceMapping = \"tree/main\"@;" \
|
||||||
-pe "s/rootProject.version = '$ATRIUM_VERSION'/rootProject.version = '$ATRIUM_NEXT_VERSION-SNAPSHOT'/;" \
|
-pe "s/rootProject.version = '$ATRIUM_VERSION'/rootProject.version = '$ATRIUM_NEXT_VERSION-SNAPSHOT'/;" \
|
||||||
-pe "s/ATRIUM_VERSION=$ATRIUM_VERSION/ATRIUM_VERSION=$ATRIUM_NEXT_VERSION/;" \
|
-pe "s/ATRIUM_VERSION=$ATRIUM_VERSION/ATRIUM_VERSION=$ATRIUM_NEXT_VERSION/;" \
|
||||||
./build.gradle
|
./build.gradle
|
||||||
perl -0777 -i \
|
perl -0777 -i \
|
||||||
-pe 's/(<!-- for master -->\n)<!--\n([\S\s]*?)-->(\n<!-- for a specific release -->)\n([\S\s]*?)\n(\n# <img)/$1\n$2$3\n<!--$4-->\n$5/;' \
|
-pe 's/(<!-- for main -->\n)<!--\n([\S\s]*?)-->(\n<!-- for a specific release -->)\n([\S\s]*?)\n(\n# <img)/$1\n$2$3\n<!--$4-->\n$5/;' \
|
||||||
-pe 's/<!(---\n❗ You are taking[^-]*?---)>/$1/;' \
|
-pe 's/<!(---\n❗ You are taking[^-]*?---)>/$1/;' \
|
||||||
-pe "s@(For instance, the \[README of v$ATRIUM_VERSION\].*tree/)master/@\$1v$ATRIUM_VERSION/@;" \
|
-pe "s@(For instance, the \[README of v$ATRIUM_VERSION\].*tree/)main/@\$1v$ATRIUM_VERSION/@;" \
|
||||||
./README.md
|
./README.md
|
||||||
git commit -a -m "prepare dev cycle of $ATRIUM_NEXT_VERSION"
|
git commit -a -m "prepare dev cycle of $ATRIUM_NEXT_VERSION"
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ alternatively the manual steps:
|
|||||||
|
|
||||||
a) search for `tree/vX.Y.Z` in all .md and build.gradle files and replace it with `tree/v0.12.0`
|
a) search for `tree/vX.Y.Z` in all .md and build.gradle files and replace it with `tree/v0.12.0`
|
||||||
b) search for `X.Y.Z/doc` in all .md files and replace with `latest#/doc`
|
b) search for `X.Y.Z/doc` in all .md files and replace with `latest#/doc`
|
||||||
c) use the master badges in README (uncomment them in README and comment out release badges)
|
c) use the main badges in README (uncomment them in README and comment out release badges)
|
||||||
d) uncomment the warning about taking a sneak peek in README and revert `tree/v0.12.0` still point to the tag
|
d) uncomment the warning about taking a sneak peek in README and revert `tree/v0.12.0` still point to the tag
|
||||||
e) change rootProject.version in build.gradle to X.Y.Z-SNAPSHOT
|
e) change rootProject.version in build.gradle to X.Y.Z-SNAPSHOT
|
||||||
f) commit & push changes
|
f) commit & push changes
|
||||||
|
|||||||
Reference in New Issue
Block a user