Skip to content

Commit

Permalink
robstoll#630 fix 'path toBe relative' infix api interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Riegel committed Oct 15, 2020
1 parent 9162079 commit e32100d
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile:
*
* @since 0.12.0
*/
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") relative: relative): Expect<T> =
_logicAppend { isRelative() }
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aDirectory): Expect<T> =
_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
Expand All @@ -311,10 +311,11 @@ infix fun <T : Path> Expect<T>.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 <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") relative: aDirectory): Expect<T> =
_logicAppend { isDirectory() }
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") relative: relative): Expect<T> =
_logicAppend { isRelative() }


/**
* Creates an [Expect] for the property [Path.extension][ch.tutteli.niok.extension]
Expand Down

0 comments on commit e32100d

Please sign in to comment.