Skip to content

Commit

Permalink
#14 add save test
Browse files Browse the repository at this point in the history
  • Loading branch information
akryvtsun committed Nov 4, 2024
1 parent 6bce00d commit f51e048
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/kotlin/guru/state/StateStorageTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package guru.state

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import java.io.File

class StateStorageTest {

Expand All @@ -15,4 +16,16 @@ class StateStorageTest {
.isNotNull()
.isEmpty()
}

@Test
fun `save empty state`() {
val storageName = "test"
val storage = StateStorage(storageName)

storage.save(emptyMap())

val state = File(storageName)
assertThat(state).exists()
state.delete()
}
}

0 comments on commit f51e048

Please sign in to comment.