Skip to content

Commit

Permalink
tidy assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-enko committed Sep 24, 2024
1 parent 02ee6b4 commit 832f87e
Showing 1 changed file with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,28 +197,22 @@ class ExampleProjectsTest {
.build {
dokkaOutputDir.shouldBeADirectory()

withClue("expect file trees are the same") {
val expectedFileTree = expectedDataDir.toTreeString()
val actualFileTree = dokkaOutputDir.toTreeString()
withClue({
"""
expectedDataDir: ${expectedDataDir.toUri()}
actualOutputDir: ${dokkaOutputDir.toUri()}
""".trimIndent()
}) {
expectedFileTree shouldBe actualFileTree
}
}

withClue({
"""
expect directories are the same
dokkaOutputDir ${dokkaOutputDir.walk().toList()}
exampleDataDir ${expectedDataDir.walk().toList()}
expectedDataDir: ${expectedDataDir.toUri()}
actualOutputDir: ${dokkaOutputDir.toUri()}
""".trimIndent()
}) {
dokkaOutputDir.shouldHaveSameStructureAs(expectedDataDir, skipEmptyDirs = true)
dokkaOutputDir.shouldHaveSameStructureAndContentAs(expectedDataDir, skipEmptyDirs = true)
withClue("expect file trees are the same") {
val expectedFileTree = expectedDataDir.toTreeString()
val actualFileTree = dokkaOutputDir.toTreeString()
expectedFileTree shouldBe actualFileTree
}

withClue("expect directories are the same") {
dokkaOutputDir.shouldHaveSameStructureAs(expectedDataDir, skipEmptyDirs = true)
dokkaOutputDir.shouldHaveSameStructureAndContentAs(expectedDataDir, skipEmptyDirs = true)
}
}
}
}
Expand Down

0 comments on commit 832f87e

Please sign in to comment.