Skip to content

Commit

Permalink
Add failing test demonstrating #422
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- authored and cortinico committed Aug 22, 2020
1 parent 8249e3c commit 698ec96
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.chuckerteam.chucker.internal.support

import android.content.Context
import com.google.common.truth.Truth.assertThat
import io.mockk.every
import io.mockk.mockk
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir
import java.io.File

internal class AndroidCacheFileFactoryTest {

private val mockContext = mockk<Context>()

@TempDir
lateinit var tempDir: File

@Test
fun createsCacheFileParents() {
every { mockContext.cacheDir } returns tempDir
val androidCacheFileFactory = AndroidCacheFileFactory(mockContext)
tempDir.deleteRecursively()
assertThat(androidCacheFileFactory.create().isFile).isTrue()
}
}

0 comments on commit 698ec96

Please sign in to comment.