diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 47d20c68ea..f053e45f85 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -12,7 +12,7 @@ Following a few guidelines so that others can quickly benefit from your contribu ## Code of Conduct 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/v0.16.0/.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behaviour to info@tutteli.ch ## How to Contribute diff --git a/README.md b/README.md index eb98d26413..e84a57c213 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - + - + # Atrium Atrium is an open-source multiplatform assertion library for Kotlin with support for JVM, JS and Android. @@ -30,12 +30,12 @@ Atrium currently provides two [API Styles](#api-styles): pure fluent and infix where both of them have their design focus on usability in conjunction with code completion functionality provided by your IDE. See [Examples](#examples) below to get a feel for how you could benefit from Atrium. ---- + **Table of Content** - [Installation](#installation) @@ -94,7 +94,7 @@ but can also be retrieved directly from [bintray](https://bintray.com/robstoll/t *gradle*: ``` buildscript { - ext { atrium_version='0.15.0' } + ext { atrium_version='0.16.0' } } repositories { mavenCentral() @@ -106,8 +106,8 @@ dependencies { 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. -Have a look at the [JVM sample projects](https://github.com/robstoll/atrium/tree/master/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. +Have a look at the [JVM sample projects](https://github.com/robstoll/atrium/tree/v0.16.0/samples/jvm) for a quick setup, or +[Maven sample project](https://github.com/robstoll/atrium/tree/v0.16.0/samples/maven) if you prefer Maven to Gradle. 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)). @@ -126,7 +126,7 @@ Also take a look at [Third-party Extensions](#third-party-extensions) which migh ``` buildscript { - ext { atrium_version='0.15.0' } + ext { atrium_version='0.16.0' } } repositories { mavenCentral() @@ -149,7 +149,7 @@ dependencies { *maven*: 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/v0.16.0/samples/maven) is provided which shows all necessary setup. That is all, you are all set. Jump to [Examples](#examples) which shows how to use Atrium. @@ -158,7 +158,7 @@ That is all, you are all set. Jump to [Examples](#examples) which shows how to u ``` buildscript { - ext { atrium_version='0.15.0' } + ext { atrium_version='0.16.0' } } repositories { mavenCentral() @@ -171,19 +171,19 @@ dependencies { 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. -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/v0.16.0/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. 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 -(see [build.gradle -> createJsTestTask](https://github.com/robstoll/atrium/tree/master/build.gradle#L290)) +(see [build.gradle -> createJsTestTask](https://github.com/robstoll/atrium/tree/v0.16.0/build.gradle#L290)) and has tests written in JS modules -(see [AdjustStackTest](https://github.com/robstoll/atrium/tree/master/core/api/atrium-core-api-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)) +(see [AdjustStackTest](https://github.com/robstoll/atrium/tree/v0.16.0/core/api/atrium-core-api-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/v0.16.0/bundles/fluent-en_GB/atrium-fluent-en_GB-common/src/test/kotlin/SmokeTest.kt)) which are executed on the JS platform as well (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/v0.16.0/build.gradle#L342)). 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)). @@ -200,7 +200,7 @@ dependencies { ``` buildscript { - ext { atrium_version='0.15.0' } + ext { atrium_version='0.16.0' } } repositories { mavenCentral() @@ -235,16 +235,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`. 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/v0.16.0/samples/multiplatform) as well for a quick setup. # Examples 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/v0.16.0/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle) in the following examples. It provides a pure fluent API for the JVM platform. 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/v0.16.0/apis/differences.md) to see how the infix API looks like, how they differ respectively. ## Your First Assertion @@ -259,7 +259,7 @@ import ch.tutteli.atrium.api.verbs.expect val x = 10 expect(x).toBe(9) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FirstExampleSpec.kt#L31)[Output](#ex-first) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FirstExampleSpec.kt#L31)[Output](#ex-first) ```text expected that subject: 10 (kotlin.Int <1234789>) @@ -273,7 +273,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` -- 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/v0.16.0/bundles/fluent-en_GB/atrium-fluent-en_GB/build.gradle) and the predefined assertion verb `expect` in the examples. 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. @@ -302,7 +302,7 @@ The next section shows how you can define multiple assertions for the same subje // two single assertions, only first evaluated expect(4 + 6).isLessThan(5).isGreaterThan(10) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L24)[Output](#ex-single) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L24)[Output](#ex-single) ```text expected that subject: 10 (kotlin.Int <1234789>) @@ -335,7 +335,7 @@ expect(4 + 6) { isGreaterThan(10) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L29)[Output](#ex-group) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L29)[Output](#ex-group) ```text expected that subject: 10 (kotlin.Int <1234789>) @@ -367,7 +367,7 @@ expect { throw IllegalArgumentException("name is empty") }.toThrow() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L37)[Output](#ex-toThrow1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L37)[Output](#ex-toThrow1) ```text expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$3$1 <1234789>) @@ -403,7 +403,7 @@ expect { throw IllegalArgumentException() }.toThrow().message.startsWith("firstName") ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L44)[Output](#ex-toThrow2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L44)[Output](#ex-toThrow2) ```text expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$4$1 <1234789>) @@ -424,7 +424,7 @@ expect { message { startsWith("firstName") } } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L50)[Output](#ex-toThrow3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L50)[Output](#ex-toThrow3) ```text expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$5$1 <1234789>) @@ -448,7 +448,7 @@ expect { throw IllegalArgumentException("name is empty", RuntimeException("a cause")) }.notToThrow() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L58)[Output](#ex-notToThrow) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L58)[Output](#ex-notToThrow) ```text expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$6$1 <1234789>) @@ -469,7 +469,7 @@ expected that subject: () -> kotlin.Nothing (readme.examples.MostExamples Notice that stacks are filtered so that you only see what is of interest. Filtering can be configured via [`ReporterBuilder`](#reporterbuilder) by choosing an appropriate -[AtriumErrorAdjuster](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting/-atrium-error-adjuster/index.html). +[AtriumErrorAdjuster](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting/-atrium-error-adjuster/index.html). Stack frames of Atrium and of test runners (Spek, Kotlintest and JUnit for JVM, mocha and jasmine for JS) are excluded per default. [Create a Feature Request](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]) in case you use a different runner, we can add yours to the list as well. @@ -511,7 +511,7 @@ expect(myPerson) .its { fullName() } // not evaluated anymore, subject String afterwards .startsWith("rob") // not evaluated anymore ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L41)[Output](#ex-its-single) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L41)[Output](#ex-its-single) ```text expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>) @@ -557,7 +557,7 @@ Feature assertions follow the common pattern of having two overloads: its { lastName }.toBe("Dummy") } ``` - ↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L49)[Output](#ex-its-group) + ↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L49)[Output](#ex-its-group) ```text expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>) @@ -585,7 +585,7 @@ expect(myPerson) .feature { f(it::fullName) } // not evaluated anymore, subject String afterwards .startsWith("rob") // not evaluated anymore ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L63)[Output](#ex-property-methods-single) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L63)[Output](#ex-property-methods-single) ```text expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>) @@ -626,7 +626,7 @@ expect(myPerson) { // forms an assertion group block feature { f(it::lastName) }.toBe("Dummy") } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L71)[Output](#ex-property-methods-group) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L71)[Output](#ex-property-methods-group) ```text expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>) @@ -675,7 +675,7 @@ expect(myPerson) .toBe("Robert aka. Stoll") // fails .startsWith("llotS") // not evaluated anymore ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L85)[Output](#ex-methods-args) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L85)[Output](#ex-methods-args) ```text expected that subject: Person(firstName=Robert, lastName=Stoll, isStudent=false) (readme.examples.FeatureExtractorSpec$1$Person <1234789>) @@ -695,7 +695,7 @@ in case you miss a shortcut. 💬 Write own feature assertion functions with additional checks. 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/v0.16.0/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultListAssertions.kt#L13) @@ -717,7 +717,7 @@ expect(myFamily) .feature("first member's name") { members.first().name } // subject narrowed to String .toBe("Peter") ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L102)[Output](#ex-arbitrary-features) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L102)[Output](#ex-arbitrary-features) ```text expected that subject: Family(members=[FamilyMember(name=Robert)]) (readme.examples.FeatureExtractorSpec$1$Family <1234789>) @@ -767,7 +767,7 @@ expect(listOf(1 to "a", 2 to "b")).get(10) { firstToBe(1) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L118)[Output](#ex-within-assertion-functions) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L118)[Output](#ex-within-assertion-functions) ```text expected that subject: [(1, a), (2, b)] (java.util.Arrays.ArrayList <1234789>) @@ -855,7 +855,7 @@ expect(x).isA() .feature { f(it::number) } .toBe(2) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L65)[Output](#ex-type-assertions-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L65)[Output](#ex-type-assertions-1) ```text expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>) @@ -877,7 +877,7 @@ expect(x).isA { feature { f(it::flag) }.toBe(false) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L71)[Output](#ex-type-assertions-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L71)[Output](#ex-type-assertions-2) ```text expected that subject: SubType2(word=hello, flag=true) (readme.examples.SubType2 <1234789>) @@ -906,7 +906,7 @@ Let us look at the case where the subject of the assertion has a [nullable type] val slogan1: String? = "postulating assertions made easy" expect(slogan1).toBe(null) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L79)[Output](#ex-nullable-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L79)[Output](#ex-nullable-1) ```text expected that subject: "postulating assertions made easy" <1234789> @@ -920,7 +920,7 @@ expected that subject: "postulating assertions made easy" <1234789> val slogan2: String? = null expect(slogan2).toBe("postulating assertions made easy") ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L83)[Output](#ex-nullable-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L83)[Output](#ex-nullable-2) ```text expected that subject: null @@ -941,7 +941,7 @@ expect(slogan2) // subject has type String? .notToBeNull() // subject narrowed to String .startsWith("atrium") ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L88)[Output](#ex-nullable-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L88)[Output](#ex-nullable-3) ```text expected that subject: null @@ -958,7 +958,7 @@ one without (example above) and one with `assertionCreator`-lambda (example belo ```kotlin expect(slogan2).notToBeNull { startsWith("atrium") } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L93)[Output](#ex-nullable-4) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L93)[Output](#ex-nullable-4) ```text expected that subject: null @@ -994,7 +994,7 @@ The following sub sections show both use cases by examples. ```kotlin expect(listOf(1, 2, 2, 4)).contains(2, 3) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L97)[Output](#ex-collection-short-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L97)[Output](#ex-collection-short-1) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1014,7 +1014,7 @@ This is reflected in the output, which tells us that we expected that the `numbe Exactly, what about the expected value `2`, why do we not see anything about it in the output? The output does not show anything about the expected value `2` because the predefined assertion verbs have configured [`ReporterBuilder`](#reporterbuilder) -to use an [Only Failure Reporter](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.core/-core-factory/new-only-failure-reporter.html) +to use an [Only Failure Reporter](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.core/-core-factory/new-only-failure-reporter.html) which shows us only assertions (or sub assertions) which failed. Back to the shortcut functions. @@ -1035,7 +1035,7 @@ expect(listOf(1, 2, 2, 4)).contains( { isGreaterThan(2).isLessThan(4) } ) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L101)[Output](#ex-collection-short-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L101)[Output](#ex-collection-short-2) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1075,7 +1075,7 @@ Following each in action: ```kotlin expect(listOf(1, 2, 3, 4)).any { isLessThan(0) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L108)[Output](#ex-collection-any) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L108)[Output](#ex-collection-any) ```text expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1092,7 +1092,7 @@ expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789> ```kotlin expect(listOf(1, 2, 3, 4)).none { isGreaterThan(2) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L111)[Output](#ex-collection-none) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L111)[Output](#ex-collection-none) ```text expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1111,7 +1111,7 @@ expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789> ```kotlin expect(listOf(1, 2, 3, 4)).all { isGreaterThan(2) } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L114)[Output](#ex-collection-all) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L114)[Output](#ex-collection-all) ```text expected that subject: [1, 2, 3, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1141,7 +1141,7 @@ Following on the last section we will start with an `inOrder` example: ```kotlin expect(listOf(1, 2, 2, 4)).contains.inOrder.only.entries({ isLessThan(3) }, { isLessThan(2) }) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L118)[Output](#ex-collection-builder-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L118)[Output](#ex-collection-builder-1) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1189,7 +1189,7 @@ and we happily answer your question there. ```kotlin expect(listOf(1, 2, 2, 4)).contains.inOrder.only.values(1, 2, 2, 3, 4) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L121)[Output](#ex-collection-builder-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L121)[Output](#ex-collection-builder-2) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1214,7 +1214,7 @@ expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789> ```kotlin expect(listOf(1, 2, 2, 4)).contains.inAnyOrder.atLeast(1).butAtMost(2).entries({ isLessThan(3) }) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L124)[Output](#ex-collection-builder-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L124)[Output](#ex-collection-builder-3) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1231,7 +1231,7 @@ expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789> ```kotlin expect(listOf(1, 2, 2, 4)).contains.inAnyOrder.only.values(1, 2, 3, 4) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L127)[Output](#ex-collection-builder-4) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L127)[Output](#ex-collection-builder-4) ```text 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 expect(listOf(1, 2, 2, 4)).contains.inAnyOrder.only.values(4, 3, 2, 2, 1) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L130)[Output](#ex-collection-builder-5) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L130)[Output](#ex-collection-builder-5) ```text expected that subject: [1, 2, 2, 4] (java.util.Arrays.ArrayList <1234789>) @@ -1280,7 +1280,7 @@ and more [Sophisticated Assertion Builder](#sophisticated-assertion-builders-1) ```kotlin expect(mapOf("a" to 1, "b" to 2)).contains("c" to 2, "a" to 1, "b" to 1) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L134)[Output](#ex-map-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L134)[Output](#ex-map-1) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1304,7 +1304,7 @@ expect(mapOf("a" to 1, "b" to 2)).contains( KeyValue("b") { isLessThan(2) } ) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L137)[Output](#ex-map-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L137)[Output](#ex-map-2) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1326,7 +1326,7 @@ Again both overloads are provided, one for key-value `Pair`s: ```kotlin expect(mapOf("a" to 1, "b" to 2)).containsOnly("b" to 2) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L145)[Output](#ex-map-only-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L145)[Output](#ex-map-only-1) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1351,7 +1351,7 @@ expect(mapOf("a" to 1, "b" to 2)).containsOnly( KeyValue("b") { isLessThan(2) } ) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L148)[Output](#ex-map-only-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L148)[Output](#ex-map-only-2) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1379,7 +1379,7 @@ again provide two overloads, one expecting key-value `Pair`s: ```kotlin expect(mapOf("a" to 1, "b" to 2)).contains.inOrder.only.entries("b" to 2, "a" to 1) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L156)[Output](#ex-map-builder-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L156)[Output](#ex-map-builder-1) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1406,7 +1406,7 @@ expect(mapOf("a" to 1, "b" to 2)).contains.inOrder.only.entries( KeyValue("a") { isLessThan(2) }, KeyValue("b") { isLessThan(2) }) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L159)[Output](#ex-map-builder-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L159)[Output](#ex-map-builder-2) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1443,7 +1443,7 @@ expect(mapOf("bernstein" to bernstein)) feature { f(it::firstName) }.toBe("Albert") } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L169)[Output](#ex-map-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L169)[Output](#ex-map-3) ```text expected that subject: {bernstein=Person(firstName=Leonard, lastName=Bernstein, age=50)} (java.util.Collections.SingletonMap <1234789>) @@ -1463,7 +1463,7 @@ expect(mapOf("a" to 1, "b" to 2)) { values { none { isGreaterThan(1) } } } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L181)[Output](#ex-map-4) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L181)[Output](#ex-map-4) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1501,7 +1501,7 @@ expect(linkedMapOf("a" to 1, "b" to 2)).asEntries().contains.inOrder.only.entrie } ) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L187)[Output](#ex-map-5) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L187)[Output](#ex-map-5) ```text expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) @@ -1522,7 +1522,7 @@ expected that subject: {a=1, b=2} (java.util.LinkedHashMap <1234789>) `isKeyValue` as well as `key` and `value` are assertion functions defined for `Map.Entry`. There are more assertion functions, a full list can be found in -[KDoc of atrium-api-fluent-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html). +[KDoc of atrium-api-fluent-en_GB](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html). ## Path Assertions @@ -1534,7 +1534,7 @@ For example, `exists` will explain which entry was the first one missing: ```kotlin expect(Paths.get("/usr/bin/noprogram")).exists() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L37)[Output](#ex-path-exists) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L37)[Output](#ex-path-exists) ```text expected that subject: /usr/bin/noprogram (sun.nio.fs.UnixPath <1234789>) @@ -1550,7 +1550,7 @@ Atrium will give details about why something cannot be accessed, for example whe ```kotlin expect(Paths.get("/root/.ssh/config")).isWritable() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L41)[Output](#ex-path-writable) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L41)[Output](#ex-path-writable) ```text expected that subject: /root/.ssh/config (sun.nio.fs.UnixPath <1234789>) @@ -1573,7 +1573,7 @@ val filePointer = Files.createSymbolicLink(directory.resolve("directory"), file) expect(filePointer.resolve("subfolder/file")).isRegularFile() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L46)[Output](#ex-path-symlink-and-parent-not-folder) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/PathSpec.kt#L46)[Output](#ex-path-symlink-and-parent-not-folder) ```text expected that subject: /tmp/atrium-path/directory/subfolder/file (sun.nio.fs.UnixPath <1234789>) @@ -1597,7 +1597,7 @@ expect("filename?") containsNot("?") } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L197)[Output](#ex-because-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L197)[Output](#ex-because-1) ```text expected that subject: "filename?" <1234789> @@ -1652,7 +1652,7 @@ expect("calling myFun with...") { } } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L35)[Output](#ex-data-driven-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L35)[Output](#ex-data-driven-1) ```text expected that subject: "calling myFun with..." <1234789> @@ -1687,7 +1687,7 @@ expect("calling myFun with ...") { } } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L49)[Output](#ex-data-driven-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L49)[Output](#ex-data-driven-2) ```text expected that subject: "calling myFun with ..." <1234789> @@ -1728,7 +1728,7 @@ expect("calling myNullableFun with ...") { } } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L67)[Output](#ex-data-driven-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/DataDrivenSpec.kt#L67)[Output](#ex-data-driven-3) ```text expected that subject: "calling myNullableFun with ..." <1234789> @@ -1746,21 +1746,21 @@ expected that subject: "calling myNullableFun with ..." <1234789> Atrium supports further assertion builders (e.g, for `CharSequence`) 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/v0.16.0/apis/differences.md) for a few more examples. This site contains also a list of all APIs with links to their assertion function catalogs. 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/v0.16.0/misc/specs/atrium-specs-common/src/main/kotlin/ch/tutteli/atrium/specs) for more examples. ## 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/v0.16.0/samples) folder, it currently contains sample projects for -- [jvm gradle](https://github.com/robstoll/atrium/tree/master/samples/jvm/) - - [maven](https://github.com/robstoll/atrium/tree/master/samples/maven/) -- [js](https://github.com/robstoll/atrium/tree/master/samples/js/) -- [multiplatform project](https://github.com/robstoll/atrium/tree/master/samples/multiplatform/) +- [jvm gradle](https://github.com/robstoll/atrium/tree/v0.16.0/samples/jvm/) + - [maven](https://github.com/robstoll/atrium/tree/v0.16.0/samples/maven/) +- [js](https://github.com/robstoll/atrium/tree/v0.16.0/samples/js/) +- [multiplatform project](https://github.com/robstoll/atrium/tree/v0.16.0/samples/multiplatform/) Are you using a different runner? A PR would be appreciated 😊. @@ -1801,7 +1801,7 @@ We try to provide a workaround whenever possible._ There is, but IntelliJ will not show it to you due to [this bug](https://youtrack.jetbrains.com/issue/KT-24836) (please upvote it). You should be able to see the KDoc of other functions without problems. -But in case, you can also browse the online documentation, e.g. [KDoc of toBe](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.cc.en_-g-b/to-be.html). +But in case, you can also browse the online documentation, e.g. [KDoc of toBe](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.cc.en_-g-b/to-be.html). @@ -1874,7 +1874,7 @@ expect { } }.toThrow { messageContains("no no no") } ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L210)[Output](#ex-add-info-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L210)[Output](#ex-add-info-3) ```text expected that subject: () -> kotlin.Nothing (readme.examples.MostExamplesSpec$1$35$1 <1234789>) @@ -1917,7 +1917,7 @@ then Atrium reminds us of the possible pitfall. For instance: ```kotlin expect(BigDecimal.TEN).isEqualIncludingScale(BigDecimal("10.0")) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L220)[Output](#ex-pitfall-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L220)[Output](#ex-pitfall-1) ```text expected that subject: 10 (java.math.BigDecimal <1234789>) @@ -1935,7 +1935,7 @@ For instance: ```kotlin expect(listOf(1)).get(0) {} ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L223)[Output](#ex-pitfall-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt#L223)[Output](#ex-pitfall-2) ```text expected that subject: [1] (java.util.Collections.SingletonList <1234789>) @@ -2012,7 +2012,7 @@ and its usage: ```kotlin expect(12).isMultipleOf(5) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L39)[Output](#ex-own-boolean-1) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L39)[Output](#ex-own-boolean-1) ```text expected that subject: 12 (kotlin.Int <1234789>) @@ -2028,9 +2028,9 @@ Let us see how we actually defined `isMultipleOf`. the assertion to itself (creating alone is not enough, it needs to be added in order that it is evaluated). The method `createAndAddAssertion` returns itself (the same `Expect`) making it easy for you to provide a fluent API as well. - The method [createAndAddAssertion](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.creating/-assertion-plant/create-and-add-assertion.html) + The method [createAndAddAssertion](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.creating/-assertion-plant/create-and-add-assertion.html) expects: - - a either a `String` or a [Translatable](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting.translating/-translatable/index.html) + - a either a `String` or a [Translatable](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting.translating/-translatable/index.html) as description of your assertion. - the representation of the expected value. - and the actual check as lambda where you typically use `it` which refers to the subject of the assertion. @@ -2053,7 +2053,7 @@ fun Expect.isEven() = ``` -We are using a [Text](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting/-text/index.html) +We are using a [Text](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting/-text/index.html) here so that `"an even number"` is not treated as a `String` in reporting. Its usage looks then as follows: @@ -2062,7 +2062,7 @@ Its usage looks then as follows: ```kotlin expect(13).isEven() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L50)[Output](#ex-own-boolean-2) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L50)[Output](#ex-own-boolean-2) ```text expected that subject: 13 (kotlin.Int <1234789>) @@ -2161,7 +2161,7 @@ Its usage is then as follows: expect(Person("Susanne", "Whitley", 43, listOf())) .hasNumberOfChildren(2) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L67)[Output](#ex-own-compose-3) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L67)[Output](#ex-own-compose-3) ```text expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>) @@ -2195,7 +2195,7 @@ but we do not have to, as `all` already checks that there is at least one elemen expect(Person("Susanne", "Whitley", 43, listOf())) .hasAdultChildren() ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L82)[Output](#ex-own-compose-4) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L82)[Output](#ex-own-compose-4) ```text expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[]) (readme.examples.Person <1234789>) @@ -2237,7 +2237,7 @@ expect(Person("Susanne", "Whitley", 43, listOf(Person("Petra", "Whitley", 12, li .children // using the val -> subsequent assertions are about children and fail fast .hasSize(2) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L92)[Output](#ex-own-compose-5) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationFunctionsSpec.kt#L92)[Output](#ex-own-compose-5) ```text expected that subject: Person(firstName=Susanne, lastName=Whitley, age=43, children=[Person(firstName=Petra, lastName=Whitley, age=12, children=[])]) (readme.examples.Person <1234789>) @@ -2299,7 +2299,7 @@ fun >> Expect.sameInitialsAs( There are a few additional methods which you can call after `mapArguments`. -See [KDoc of ArgumentMapperBuilder](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.logic.utils/-argument-mapper-builder/index.html). +See [KDoc of ArgumentMapperBuilder](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.logic.utils/-argument-mapper-builder/index.html). In case you want to provide your own implementation, it suffices to create an extension function for `ArgumentMapperBuilder`. @@ -2309,20 +2309,20 @@ 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 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/v0.16.0/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. 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) was the API level) so that you can reuse and compose them in other ways. - `changeSubject` which allows to change the subject either: - - `unreported`; meaning it does not show up in reporting (e.g. `Expect>.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)) - - reported, using `reportBuilder`; meaning a subject transformation which is shown in reporting as it incorporates a transformation (e.g. `isA` 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)) -- `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)) -- `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)) + - `unreported`; meaning it does not show up in reporting (e.g. `Expect>.asList()` uses it, see [arrayAssertions](https://github.com/robstoll/atrium/tree/v0.16.0/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. `isA` uses it, see [AnyAssertions](https://github.com/robstoll/atrium/tree/v0.16.0/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/v0.16.0/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/v0.16.0/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 -(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/0.16.0/doc/ch.tutteli.atrium.assertions.builders/-assertion-builder/index.html) for more information) 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) @@ -2337,7 +2337,7 @@ Unfortunately we do not have the time to cover all cases, so let us know if you Do you want to write an own sophisticated assertion builder (or extend a current with more options) instead of an assertion function? Great, we do not provide documentation yet (had only one question about it so far). Therefore, please have a look at the implementation, for instance how the sophisticated assertion builders for `Iterable` are defined: -[ch.tutteli.atrium.creating.iterable.contains](https://github.com/robstoll/atrium/tree/master/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/iterable/contains). +[ch.tutteli.atrium.creating.iterable.contains](https://github.com/robstoll/atrium/tree/v0.16.0/domain/api/atrium-domain-api-common/src/main/kotlin/ch/tutteli/atrium/domain/creating/iterable/contains). Notice that the implementation supports [Internationalization](#internationalization-1). We are willing to provide more documentation if you need it (please open an issue). @@ -2351,7 +2351,7 @@ Atrium offers three assertion verbs out of the box: `expect`, `assert` and `asse But you can also define your own set of assertion verbs if they do not suite you or if you do not want that all of them are available in your classpath. In order to create an own assertion 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/v0.16.0/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 -- notice that you can also use a `String` for the assertion 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). @@ -2390,7 +2390,7 @@ What are the drawbacks: ## Use own Components Replacing existing components with your own (or third-party) components can be done when specifying an own expection verb -via `withOptions`. See for instance [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/master/misc/verbs-internal/atrium-verbs-internal-common/src/main/kotlin/ch.tutteli.atrium.api.verbs.internal/atriumVerbs.kt#L31) +via `withOptions`. See for instance [atriumVerbs.kt](https://github.com/robstoll/atrium/tree/v0.16.0/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`. Another example, say you prefer multi-line reporting over single-line reporting, @@ -2423,7 +2423,7 @@ Following an example using the expectation verb ```kotlin expect(10).toBe(9) ``` -↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationVerbSpec.kt#L51)[Output](#ex-own-expectation-verb) +↑ [Example](https://github.com/robstoll/atrium/tree/v0.16.0/misc/tools/readme-examples/src/main/kotlin/readme/examples/OwnExpectationVerbSpec.kt#L51)[Output](#ex-own-expectation-verb) ```text expected the subject: @@ -2443,7 +2443,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]). There are more options to choose from. Take a look at the -[DefaultComponentFactoryContainer](https://github.com/robstoll/atrium/tree/master/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt#L121) +[DefaultComponentFactoryContainer](https://github.com/robstoll/atrium/tree/v0.16.0/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt#L121) to see the default configuration. # Internationalization @@ -2474,24 +2474,24 @@ enum class DescriptionIntAssertion(override val value: String) : StringBasedTran Typically you would put `DescriptionIntAssertion` into an own module (jar) so that it could be replaced (with zero performance cost) by another language representation. 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/v0.16.0/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle) uses `atrium-translations-en_GB-common` whereas 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/v0.16.0/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle) uses `atrium-translations-de_CH-common`.
💬 Using a TranslationSupplier Next to providing translations via code you can also use a -[TranslationSupplier](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting.translating/-translation-supplier/index.html) -based [Translator](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting.translating/-translator/index.html) +[TranslationSupplier](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting.translating/-translation-supplier/index.html) +based [Translator](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting.translating/-translator/index.html) by configuring the [`ReporterBuilder`](#reporterbuilder) accordingly (e.g. use `withDefaultTranslationSupplier` instead of `withoutTranslations`). Atrium supports a properties files based `TranslationSupplier` for JVM (a supplier for JS will follow) which is more or less what [ResourceBundle](https://docs.oracle.com/javase/tutorial/i18n/resbundle/propfile.html) provides out of the box. Yet, a `Translator` uses a more enhanced fallback mechanism compared to a `ResourceBundle`. -For further technical information have a look at the KDoc of [Translator](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting.translating/-translator/index.html). +For further technical information have a look at the KDoc of [Translator](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.reporting.translating/-translator/index.html). Notice though, that we plan to move away from the `ResourceBundle`-inspired approach due to enconding problems and missing implementations on other platforms than JVM. @@ -2533,7 +2533,7 @@ We split up the function in two parts: API and logic merely appends the assertion created by the logic to the `Expect`. Typically, you put the API function in one module (jar) and the logic in another (so that the API can be exchanged). -In the logic module we define and extension method for [AssertionContainer](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.creating/-assertion-container/index.html) +In the logic module we define and extension method for [AssertionContainer](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.creating/-assertion-container/index.html) @@ -2545,7 +2545,7 @@ fun AssertionContainer.isMultipleOf(base: Int): Assertion = ``` -In the above example we created a simple [DescriptiveAssertion](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.assertions/-descriptive-assertion/index.html) +In the above example we created a simple [DescriptiveAssertion](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.assertions/-descriptive-assertion/index.html) with the help of `createDescriptiveAssertion` defined on AssertionContainer. We pass in a description (`IS_MULTIPLE_OF`), use `base` as representation of the assertion and defined a lambda which implements a test to define whether the assertion holds or not. @@ -2585,17 +2585,17 @@ Both have their design focus on interoperability with code completion functional -- so that you can let your IDE do some of the work. Atrium is -[built up by different modules](https://docs.atriumlib.org/latest#/doc/) +[built up by different modules](https://docs.atriumlib.org/0.16.0/doc/) and it is your choice which implementation you want to use. 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 assertion 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): -- [atrium-fluent-en_GB](https://github.com/robstoll/atrium/tree/master/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-fluent-en_GB](https://github.com/robstoll/atrium/tree/v0.16.0/bundles/fluent-en_GB/atrium-fluent-en_GB-common/build.gradle) +- [atrium-infix-en_GB](https://github.com/robstoll/atrium/tree/v0.16.0/bundles/infix-en_GB/atrium-infix-en_GB-common/build.gradle) 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/v0.16.0/apis/differences.md) for more information and to see how the API styles differ. @@ -2610,15 +2610,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. 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/v0.16.0/logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/utils/nullable.kt#L19) 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/v0.16.0/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`. -- [`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/v0.16.0/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. -- [`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/v0.16.0/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. -- [`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/v0.16.0/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. @@ -2674,8 +2674,8 @@ expect(sequenceOf(1, 2, 3)).feature { f(it::asIterable) }.contains(2) ## Where do I find a list of all available functions? Atrium provides KDoc for all APIs - have a look at their KDoc: -- [atrium-api-fluent-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html) -- [atrium-api-infix-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.infix.en_-g-b/index.html) +- [atrium-api-fluent-en_GB](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html) +- [atrium-api-infix-en_GB](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.infix.en_-g-b/index.html) ## Problems in conjunction with `feature` @@ -2711,7 +2711,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). 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/v0.16.0/.github/CONTRIBUTING.md) for further suggestions and guidelines. # Sponsors diff --git a/apis/differences.md b/apis/differences.md index d47a99ea76..4757ea30ec 100644 --- a/apis/differences.md +++ b/apis/differences.md @@ -14,13 +14,13 @@ These modules bundle: Following a list of the available bundle-modules. The links point to the KDoc of their included API where you find an overview of all available assertion functions of the API. -- [atrium-fluent-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html) -- [atrium-infix-en_GB](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.api.infix.en_-g-b/index.html) +- [atrium-fluent-en_GB](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.fluent.en_-g-b/index.html) +- [atrium-infix-en_GB](https://docs.atriumlib.org/0.16.0/doc/ch.tutteli.atrium.api.infix.en_-g-b/index.html) ---- 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/v0.16.0/README.md#installation) for the rest): ``` dependencies { diff --git a/build.gradle b/build.gradle index ae6645a0b1..9426b078ed 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - rootProject.version = '0.16.0-SNAPSHOT' + rootProject.version = '0.16.0' rootProject.group = 'ch.tutteli.atrium' def toolProjectsFun = subprojects.findAll { @@ -57,7 +57,7 @@ buildscript { ghPages_version = rootProject.version srcKotlin = 'src/main/kotlin' github_url = "https://github.com/robstoll/${rootProject.name}" - dokka_sourceMapping = "tree/master" + dokka_sourceMapping = "tree/v0.16.0" toolProjects = toolProjectsFun @@ -480,7 +480,7 @@ Release & deploy a commit Either use the following commands or the manual steps below -export ATRIUM_PREVIOUS_VERSION=0.15.0 +export ATRIUM_PREVIOUS_VERSION=0.16.0 export ATRIUM_VERSION=0.16.0 find ./ -name "*.md" | xargs perl -0777 -i \ -pe "s@$ATRIUM_PREVIOUS_VERSION@$ATRIUM_VERSION@g;" \ @@ -559,7 +559,7 @@ Prepare next dev cycle Either use the following commands or the manual steps below -export ATRIUM_VERSION=0.15.0 +export ATRIUM_VERSION=0.16.0 export ATRIUM_NEXT_VERSION=0.16.0 find ./ -name "*.md" | xargs perl -0777 -i \ -pe "s@tree/v$ATRIUM_VERSION@tree/master@g;" \