Skip to content

Commit

Permalink
Fixed tests to run on Android 23
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Aug 9, 2023
1 parent 8249d95 commit 78f0cea
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import com.nononsenseapps.feeder.model.OPMLParserHandler
import java.io.File
import java.io.IOException
import java.net.URL
import kotlin.io.path.createTempDirectory
import kotlin.io.path.createTempFile
import kotlin.random.Random
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import org.junit.After
Expand Down Expand Up @@ -66,8 +65,8 @@ class OPMLTest : DIAware {
@Before
fun setup() {
// Get internal data dir
dir = createTempDirectory().toFile()
path = createTempFile().toFile()
dir = context.externalCacheDir!!.resolve("${Random.nextInt()}").also { it.mkdir() }
path = context.externalCacheDir!!.resolve("${Random.nextInt()}").also { it.createNewFile() }
assertTrue("Need to be able to write to data dir $dir", dir!!.canWrite())

db = Room.inMemoryDatabaseBuilder(context, AppDatabase::class.java).build()
Expand Down

0 comments on commit 78f0cea

Please sign in to comment.