Platform (all, jvm, js): all
Extension (none, kotlin 1.3): none
expect(path).toBeAnEmptyDirectory()
//instead of
expect(path)
.toBeADirectory()
.feature("findFirstFile", { Files.list(this).use { it.findFirst() } }) {
isEmpty()
}
Following the things you need to do:
logic
toBeEmptyDirectory (see other functions as a guideline)iterator.hasNext()api-fluent
toBeAnEmptyDirectory in a new file called pathExpectations.kt (see for instance isDirectory in pashAssertions.kt as a guideline)@since 0.16.0 (adapt to current milestone) to KDOCapi-infix
toBe which expects anEmptyDirectory in a new file called pathExpectations.kt (see toBe aDirectory in pathAssertions.kt as a guideline)@since 0.16.0 (adapt to current milestone) to KDOCI'll work on this if you would like to take this issue over.I'll work on this
@Samuellucas97 I have updated the description. Let me know in case you need help
@Samuellucas97 let us know in case you need help
I'd like to try this, toBeEmptyDirectory simply asserts whether the path points to an empty directory, correct?
@mai2412 exactly. Use the existing functionality for toBeADirectory so that the reporting in error cases is already advanced
Do you mean isDirectory? I can't find toBeADirectory
@mai2412 yes, isDirectory in DefaultPathAssertions. Sorry