From 591e6ec8e566eaecc28a427af9290a6680826dc5 Mon Sep 17 00:00:00 2001 From: Jakub Riegel Date: Thu, 15 Oct 2020 13:34:24 +0200 Subject: [PATCH] #630 add Path.isRelative method --- .../atrium/api/infix/en_GB/pathAssertions.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt index ecfc148350..8046cc85c2 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt @@ -293,12 +293,12 @@ infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile: * * @since 0.12.0 */ -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") relative: relative): Expect = - _logicAppend { isRelative() } +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aDirectory): Expect = + _logicAppend { isDirectory() } /** - * Expects that the subject of the assertion (a [Path]) is a directory; - * meaning that there is a file system entry at the location the [Path] points to and that is a directory. + * Expects that the subject of the assertion (a [Path]) is a relative path; + * meaning that the [Path] specified in this instance does not start at system root. * * This assertion _resolves_ symbolic links. * Therefore, if a symbolic link exists at the location the subject points to, search will continue @@ -311,10 +311,11 @@ infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") relative: rela * @return An [Expect] for the current subject of the assertion. * @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. * - * @since 0.12.0 + * @since 0.14.0 */ -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") relative: aDirectory): Expect = - _logicAppend { isDirectory() } +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") relative: relative): Expect = + _logicAppend { isRelative() } + /** * Creates an [Expect] for the property [Path.extension][ch.tutteli.niok.extension]