diff --git a/README.md b/README.md index cbed9c321..441cf53e5 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,7 @@ expect(4 + 6) { ```kotlin expect { - //this block does something but eventually... + // this block does something but eventually... throw IllegalArgumentException("name is empty") }.toThrow() ``` @@ -432,7 +432,7 @@ There is also the counterpart to `toThrow` named `notToThrow`: ```kotlin expect { - //this block does something but eventually... + // this block does something but eventually... throw IllegalArgumentException("name is empty", RuntimeException("a cause")) }.notToThrow() ``` @@ -496,8 +496,8 @@ using the extension method `its`. ```kotlin expect(myPerson) .its({ isStudent }) { toEqual(true) } // fails, subject still Person afterwards - .its { fullName() } // not evaluated anymore, subject String afterwards - .toStartWith("rob") // not evaluated anymore + .its { fullName() } // not evaluated anymore, subject String afterwards + .toStartWith("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) @@ -537,8 +537,8 @@ Feature assertions follow the common pattern of having two overloads: expect(myPerson) { // forms an assertion group block its({ firstName }) { // forms an assertion group block - toStartWith("Pe") // fails - toEndWith("er") // is evaluated nonetheless + toStartWith("Pe") // fails + toEndWith("er") // is evaluated nonetheless } // fails as a whole // still evaluated, as it is in outer assertion group block @@ -570,8 +570,8 @@ as description. Following the first example rewritten to `feature`. ```kotlin expect(myPerson) .feature({ f(it::isStudent) }) { toEqual(true) } // fails, subject still Person afterwards - .feature { f(it::fullName) } // not evaluated anymore, subject String afterwards - .toStartWith("rob") // not evaluated anymore + .feature { f(it::fullName) } // not evaluated anymore, subject String afterwards + .toStartWith("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) @@ -606,8 +606,8 @@ Following the second example rewritten from `its` to `feature`: expect(myPerson) { // forms an assertion group block feature({ f(it::firstName) }) { // forms an assertion group block - toStartWith("Pe") // fails - toEndWith("er") // is evaluated nonetheless + toStartWith("Pe") // fails + toEndWith("er") // is evaluated nonetheless } // fails as a whole // still evaluated, as it is in outer assertion group block @@ -660,8 +660,8 @@ Last but not least, let us have a look at an example where a method with argumen ```kotlin expect(myPerson) .feature { f(it::nickname, false) } // subject narrowed to String - .toEqual("Robert aka. Stoll") // fails - .toStartWith("llotS") // not evaluated anymore + .toEqual("Robert aka. Stoll") // fails + .toStartWith("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) @@ -702,7 +702,7 @@ data class Family(val members: List) val myFamily = Family(listOf(FamilyMember("Robert"))) expect(myFamily) .feature("number of members", { members.size }) { toEqual(1) } // subject still Family afterwards - .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") ``` ↑ [Example](https://github.com/robstoll/atrium/tree/master/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt#L102)[Output](#ex-arbitrary-features) @@ -925,8 +925,8 @@ Following an example: ```kotlin -expect(slogan2) // subject has type String? - .notToEqualNull() // subject narrowed to String +expect(slogan2) // subject has type String? + .notToEqualNull() // subject is narrowed to String .toStartWith("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) diff --git a/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt b/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt index 54729e21f..e430aa477 100644 --- a/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt +++ b/misc/tools/readme-examples/src/main/kotlin/readme/examples/FeatureExtractorSpec.kt @@ -41,8 +41,8 @@ class FeatureExtractorSpec : Spek({ test("ex-its-single") { expect(myPerson) .its({ isStudent }) { toEqual(true) } // fails, subject still Person afterwards - .its { fullName() } // not evaluated anymore, subject String afterwards - .toStartWith("rob") // not evaluated anymore + .its { fullName() } // not evaluated anymore, subject String afterwards + .toStartWith("rob") // not evaluated anymore } //@formatter:off @@ -50,8 +50,8 @@ class FeatureExtractorSpec : Spek({ expect(myPerson) { // forms an assertion group block its({ firstName }) { // forms an assertion group block - toStartWith("Pe") // fails - toEndWith("er") // is evaluated nonetheless + toStartWith("Pe") // fails + toEndWith("er") // is evaluated nonetheless } // fails as a whole // still evaluated, as it is in outer assertion group block @@ -63,8 +63,8 @@ class FeatureExtractorSpec : Spek({ test("ex-property-methods-single") { expect(myPerson) .feature({ f(it::isStudent) }) { toEqual(true) } // fails, subject still Person afterwards - .feature { f(it::fullName) } // not evaluated anymore, subject String afterwards - .toStartWith("rob") // not evaluated anymore + .feature { f(it::fullName) } // not evaluated anymore, subject String afterwards + .toStartWith("rob") // not evaluated anymore } //@formatter:off @@ -72,8 +72,8 @@ class FeatureExtractorSpec : Spek({ expect(myPerson) { // forms an assertion group block feature({ f(it::firstName) }) { // forms an assertion group block - toStartWith("Pe") // fails - toEndWith("er") // is evaluated nonetheless + toStartWith("Pe") // fails + toEndWith("er") // is evaluated nonetheless } // fails as a whole // still evaluated, as it is in outer assertion group block @@ -85,8 +85,8 @@ class FeatureExtractorSpec : Spek({ test("ex-methods-args") { expect(myPerson) .feature { f(it::nickname, false) } // subject narrowed to String - .toEqual("Robert aka. Stoll") // fails - .toStartWith("llotS") // not evaluated anymore + .toEqual("Robert aka. Stoll") // fails + .toStartWith("llotS") // not evaluated anymore } //@formatter:off @@ -103,7 +103,7 @@ class FeatureExtractorSpec : Spek({ //snippet-Family-insert expect(myFamily) .feature("number of members", { members.size }) { toEqual(1) } // subject still Family afterwards - .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") } diff --git a/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt b/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt index ed2487693..e212985bf 100644 --- a/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt +++ b/misc/tools/readme-examples/src/main/kotlin/readme/examples/MostExamplesSpec.kt @@ -36,7 +36,7 @@ class MostExamplesSpec : Spek({ test("ex-toThrow1") { expect { - //this block does something but eventually... + // this block does something but eventually... throw IllegalArgumentException("name is empty") }.toThrow() } @@ -57,7 +57,7 @@ class MostExamplesSpec : Spek({ test("ex-notToThrow") { expect { - //this block does something but eventually... + // this block does something but eventually... throw IllegalArgumentException("name is empty", RuntimeException("a cause")) }.notToThrow() } @@ -86,8 +86,8 @@ class MostExamplesSpec : Spek({ } val slogan2: String? = null test("ex-nullable-3") { - expect(slogan2) // subject has type String? - .notToEqualNull() // subject narrowed to String + expect(slogan2) // subject has type String? + .notToEqualNull() // subject is narrowed to String .toStartWith("atrium") } test("ex-nullable-4") {