File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
assertk/src/jvmTest/kotlin/test/assertk/assertions Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,13 @@ class FileTest {
207207 assertThat(fileWithText).text().contains(" Forty-two" )
208208 }
209209
210+ // region bytes
211+ @Test
212+ fun hasBytes_correct_value_passes () {
213+ assertThat(fileWithText).bytes().isEqualTo(fileWithText.readBytes())
214+ }
215+ // endregion
216+
210217 @Test
211218 fun contains_wrong_substring_fails () {
212219 val error = assertFailsWith<AssertionError > {
Original file line number Diff line number Diff line change @@ -59,6 +59,23 @@ class PathTest {
5959 }
6060 // endregion
6161
62+
63+ // region isExecutable
64+ @Test
65+ fun isExecutable_value_regular_file_executable_passes () {
66+ regularFile!! .toFile().setExecutable(true )
67+ assertThat(regularFile!! ).isExecutable()
68+ }
69+
70+ @Test
71+ fun isExecutable_value_regular_file_not_executable_fails () {
72+ val error = assertFailsWith<AssertionError > {
73+ assertThat(regularFile!! ).isExecutable()
74+ }
75+ assertEquals(" expected <$regularFile > to be an executable, but it is not" , error.message)
76+ }
77+ // endregion
78+
6279 // region isHidden
6380 @Test
6481 fun isHidden_value_regular_file_not_hidden_fails () {
You can’t perform that action at this time.
0 commit comments