mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
cleanup Path.resolve
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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].
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user