File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
src/test/kotlin/cafe/adriel/hal Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ dependencies {
15
15
TestLib . all. forEach { testImplementation it }
16
16
}
17
17
18
-
19
18
afterEvaluate {
20
19
publishing {
21
20
publications {
Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ import cafe.adriel.hal.util.CustomStateObserver
5
5
import cafe.adriel.hal.util.TestCoroutineScopeRule
6
6
import cafe.adriel.hal.util.TurnstileState
7
7
import io.mockk.coVerify
8
- import io.mockk.spyk
8
+ import io.mockk.mockk
9
9
import kotlinx.coroutines.flow.MutableStateFlow
10
10
import org.junit.Before
11
- import org.junit.Ignore
12
11
import org.junit.Rule
13
12
import org.junit.Test
14
13
@@ -21,8 +20,8 @@ class StateObserverTest {
21
20
private lateinit var flowObserver: FlowStateObserver <TurnstileState >
22
21
private lateinit var customObserver: CustomStateObserver <TurnstileState >
23
22
24
- private val flowListener = spyk(::flowOnStateChanged )
25
- private val customListener = spyk(::customOnStateChanged )
23
+ private val flowListener = mockk < suspend ( TurnstileState ) -> Unit > (relaxed = true )
24
+ private val customListener = mockk < ( TurnstileState ) -> Unit > (relaxed = true )
26
25
27
26
@Before
28
27
fun setup () {
@@ -45,7 +44,6 @@ class StateObserverTest {
45
44
}
46
45
47
46
@Test
48
- @Ignore(" Broke after update Coroutines, needs investigation" )
49
47
fun `when flow emits a state then flow observer calls listener` () {
50
48
coVerify { flowListener(TurnstileState .Locked ) }
51
49
}
@@ -54,12 +52,4 @@ class StateObserverTest {
54
52
fun `when flow emits a state then custom observer calls listener` () {
55
53
coVerify { customListener(TurnstileState .Locked ) }
56
54
}
57
-
58
- private suspend fun flowOnStateChanged (state : TurnstileState ) {
59
- // Do nothing
60
- }
61
-
62
- private fun customOnStateChanged (state : TurnstileState ) {
63
- // Do nothing
64
- }
65
55
}
You can’t perform that action at this time.
0 commit comments