Skip to content

Commit 37233cd

Browse files
committed
Add samples for pathAssertions of api-infix (#999)
1 parent 1b28ddf commit 37233cd

File tree

2 files changed

+333
-2
lines changed

2 files changed

+333
-2
lines changed

apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt

+38-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ infix fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
7474
*
7575
* @return an [Expect] for the subject of `this` expectation.
7676
*
77+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toExist
78+
*
7779
* @since 0.12.0
7880
*/
7981
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect<T> =
@@ -89,6 +91,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") existing: exis
8991
*
9092
* @return an [Expect] for the subject of `this` expectation.
9193
*
94+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.notToExist
95+
*
9296
* @since 0.12.0
9397
*/
9498
infix fun <T : Path> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") existing: existing): Expect<T> =
@@ -102,6 +106,8 @@ infix fun <T : Path> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") existing: e
102106
*
103107
* @return The newly created [Expect] for the extracted feature.
104108
*
109+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.extensionFeature
110+
*
105111
* @since 0.12.0
106112
*/
107113
val <T : Path> Expect<T>.extension: Expect<String>
@@ -116,6 +122,8 @@ val <T : Path> Expect<T>.extension: Expect<String>
116122
*
117123
* @return an [Expect] for the subject of `this` expectation.
118124
*
125+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.extension
126+
*
119127
* @since 0.12.0
120128
*/
121129
infix fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
@@ -129,6 +137,8 @@ infix fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() ->
129137
*
130138
* @return The newly created [Expect] for the extracted feature.
131139
*
140+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.fileNameFeature
141+
*
132142
* @since 0.12.0
133143
*/
134144
val <T : Path> Expect<T>.fileName: Expect<String>
@@ -143,6 +153,8 @@ val <T : Path> Expect<T>.fileName: Expect<String>
143153
*
144154
* @return an [Expect] for the subject of `this` expectation.
145155
*
156+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.fileName
157+
*
146158
* @since 0.12.0
147159
*/
148160
infix fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
@@ -156,6 +168,8 @@ infix fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> U
156168
*
157169
* @return The newly created [Expect] for the extracted feature.
158170
*
171+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.fileNameWithoutExtension
172+
*
159173
* @since 0.12.0
160174
*/
161175
val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
@@ -182,6 +196,8 @@ infix fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect
182196
*
183197
* @return The newly created [Expect] for the extracted feature.
184198
*
199+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.parentFeature
200+
*
185201
* @since 0.12.0
186202
*/
187203
val <T : Path> Expect<T>.parent: Expect<Path>
@@ -194,6 +210,8 @@ val <T : Path> Expect<T>.parent: Expect<Path>
194210
*
195211
* @return an [Expect] for the subject of `this` expectation.
196212
*
213+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.parent
214+
*
197215
* @since 0.12.0
198216
*/
199217
infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
@@ -206,6 +224,8 @@ infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit)
206224
*
207225
* @return The newly created [Expect] for the extracted feature.
208226
*
227+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.resolveFeature
228+
*
209229
* @since 0.12.0
210230
*/
211231
infix fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
@@ -221,6 +241,8 @@ infix fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
221241
*
222242
* @return The newly created [Expect] for the extracted feature.
223243
*
244+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.resolve
245+
*
224246
* @since 0.12.0
225247
*/
226248
infix fun <T : Path> Expect<T>.resolve(path: PathWithCreator<Path>): Expect<T> =
@@ -249,6 +271,8 @@ fun <E> path(path: String, assertionCreator: Expect<E>.() -> Unit): PathWithCrea
249271
*
250272
* @return an [Expect] for the subject of `this` expectation.
251273
*
274+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeReadable
275+
*
252276
* @since 0.12.0
253277
*/
254278
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") readable: readable): Expect<T> =
@@ -266,6 +290,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") readable: read
266290
*
267291
* @return an [Expect] for the subject of `this` expectation.
268292
*
293+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeWritable
294+
*
269295
* @since 0.12.0
270296
*/
271297
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") writable: writable): Expect<T> =
@@ -287,6 +313,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") writable: writ
287313
*
288314
* @return an [Expect] for the subject of `this` expectation.
289315
*
316+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeExecutable
317+
*
290318
* @since 0.14.0
291319
*/
292320
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") executable: executable): Expect<T> =
@@ -307,6 +335,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") executable: ex
307335
*
308336
* @return an [Expect] for the subject of `this` expectation.
309337
*
338+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeARegularFile
339+
*
310340
* @since 0.12.0
311341
*/
312342
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile: aRegularFile): Expect<T> =
@@ -327,6 +357,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile:
327357
*
328358
* @return an [Expect] for the subject of `this` expectation.
329359
*
360+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeADirectory
361+
*
330362
* @since 0.12.0
331363
*/
332364
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aDirectory): Expect<T> =
@@ -343,7 +375,7 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aD
343375
*
344376
* @return an [Expect] for the subject of `this` expectation.
345377
*
346-
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.deprecated.PathAssertionSamples.toBeASymbolicLink
378+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeASymbolicLink
347379
*
348380
* @since 0.16.0
349381
*/
@@ -357,6 +389,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aSymbolicLink:
357389
*
358390
* @return an [Expect] for the subject of `this` expectation.
359391
*
392+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeAbsolute
393+
*
360394
* @since 0.14.0
361395
*/
362396
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") absolute: absolute): Expect<T> =
@@ -369,6 +403,8 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") absolute: abso
369403
*
370404
* @return an [Expect] for the subject of `this` expectation.
371405
*
406+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeRelative
407+
*
372408
* @since 0.14.0
373409
*/
374410
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") relative: relative): Expect<T> =
@@ -446,7 +482,7 @@ fun directoryEntries(entry: String, vararg otherEntries: String) = DirectoryEntr
446482
*
447483
* @return an [Expect] for the subject of `this` expectation.
448484
*
449-
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.deprecated.PathAssertionSamples.toBeAnEmptyDirectory
485+
* @sample ch.tutteli.atrium.api.infix.en_GB.samples.PathExpectationSamples.toBeAnEmptyDirectory
450486
*
451487
* @since 0.16.0
452488
*/

0 commit comments

Comments
 (0)