cleanup Path.resolve

This commit is contained in:
Robert Stoll
2020-02-18 18:38:41 +01:00
parent 9cb8c5de47
commit 8ff3a7495e
3 changed files with 6 additions and 6 deletions

View File

@@ -157,7 +157,7 @@ fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expe
ExpectImpl.path.parent(this).addToInitial(assertionCreator)
/**
* Expects that [other] resolve against this [Path] and creates an [Expect] for the resolved [Path]
* Expects that [other] resolves against this [Path] and creates an [Expect] for the resolved [Path]
* so that further fluent calls are assertions about it.
*
* @return The newly created [Expect].
@@ -169,7 +169,7 @@ fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
ExpectImpl.path.resolve(this, other).getExpectOfFeature()
/**
* Expect that [other] resolve against this [Path] and that the resolved [Path] holds all assertions the
* Expects that [other] resolves against this [Path] and that the resolved [Path] holds all assertions the
* given [assertionCreator] creates for it and returns this assertion container.
*
* @return This assertion container to support a fluent API.

View File

@@ -159,7 +159,7 @@ infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit)
ExpectImpl.path.parent(this).addToInitial(assertionCreator)
/**
* Expects that [other] resolve against this [Path] and creates an [Expect] for the resolved [Path]
* Expects that [other] resolves against this [Path] and creates an [Expect] for the resolved [Path]
* so that further fluent calls are assertions about it.
*
* @return The newly created [Expect].

View File

@@ -9,7 +9,7 @@ class PathFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.PathFeatur
property<Path, Path>(Expect<Path>::parent),
fun1<Path, Expect<Path>.() -> Unit>(Expect<Path>::parent),
feature1<Path, String, Path>(Expect<Path>::resolve),
fun2<Path, String, Expect<Path>.() -> Unit>(Expect<Path>::resolve), //resolve with assertionCreator not implemented in this API
"resolve with assertionCreator not implemented in this API" to ::resolve,
property<Path, String>(Expect<Path>::fileName),
fun1<Path, Expect<String>.() -> Unit>(Expect<Path>::fileName),
property<Path, String>(Expect<Path>::fileNameWithoutExtension),
@@ -39,5 +39,5 @@ class PathFeatureAssertionsSpec : ch.tutteli.atrium.specs.integration.PathFeatur
}
}
private fun <T: Path> Expect<T>.resolve(other: String, assertionCreator: Expect<Path>.() -> Unit): Expect<Path> =
(this resolve other).addAssertionsCreatedBy(assertionCreator)
private fun resolve(expect: Expect<Path>, other: String, assertionCreator: Expect<Path>.() -> Unit): Expect<Path> =
(expect resolve other).addAssertionsCreatedBy(assertionCreator)