toHaveTheSameBinaryContentAs
Expects that the subject of this expectation (a Path) has the same binary content as targetPath.
Return
an Expect for the subject of this expectation.
Since
0.17.0
Samples
val notEmptyFilePath = tempDir.newFile("test_file_1")
notEmptyFilePath.writeBytes(byteArrayOf(1, 2, 3))
val expectedFilePath = tempDir.newFile("test_file_2")
expectedFilePath.writeBytes(byteArrayOf(1, 2, 3))
val emptyFilePath = tempDir.newFile("test_file_3")
expect(notEmptyFilePath).toHaveTheSameBinaryContentAs(expectedFilePath)
fails { // because nothing is written inside of `emptyFilePath`
expect(emptyFilePath).toHaveTheSameBinaryContentAs(expectedFilePath)
}