Skip to content

Commit

Permalink
test: close DB in TimelineDaoTest (#512)
Browse files Browse the repository at this point in the history
The previous code forgot to close the DB after TimelineDaoTest was run,
so a warning message was displayed when the test was run locally.

Close the database using the `@After` annotation.

Fixes #511
  • Loading branch information
sanao1006 authored Mar 8, 2024
1 parent 21b85fc commit 0105a81
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import javax.inject.Inject
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
Expand All @@ -51,6 +52,11 @@ class TimelineDaoTest {
hilt.inject()
}

@After
fun tearDown() {
db.close()
}

@Test
fun insertGetStatus() = runBlocking {
val setOne = makeStatus(statusId = 3)
Expand Down

0 comments on commit 0105a81

Please sign in to comment.