diff --git a/hal-core/build.gradle b/hal-core/build.gradle index 4b30b54..2d25422 100644 --- a/hal-core/build.gradle +++ b/hal-core/build.gradle @@ -15,7 +15,6 @@ dependencies { TestLib.all.forEach { testImplementation it } } - afterEvaluate { publishing { publications { diff --git a/hal-core/src/test/kotlin/cafe/adriel/hal/StateObserverTest.kt b/hal-core/src/test/kotlin/cafe/adriel/hal/StateObserverTest.kt index 79e56e1..8c52881 100644 --- a/hal-core/src/test/kotlin/cafe/adriel/hal/StateObserverTest.kt +++ b/hal-core/src/test/kotlin/cafe/adriel/hal/StateObserverTest.kt @@ -5,10 +5,9 @@ import cafe.adriel.hal.util.CustomStateObserver import cafe.adriel.hal.util.TestCoroutineScopeRule import cafe.adriel.hal.util.TurnstileState import io.mockk.coVerify -import io.mockk.spyk +import io.mockk.mockk import kotlinx.coroutines.flow.MutableStateFlow import org.junit.Before -import org.junit.Ignore import org.junit.Rule import org.junit.Test @@ -21,8 +20,8 @@ class StateObserverTest { private lateinit var flowObserver: FlowStateObserver private lateinit var customObserver: CustomStateObserver - private val flowListener = spyk(::flowOnStateChanged) - private val customListener = spyk(::customOnStateChanged) + private val flowListener = mockk Unit>(relaxed = true) + private val customListener = mockk<(TurnstileState) -> Unit>(relaxed = true) @Before fun setup() { @@ -45,7 +44,6 @@ class StateObserverTest { } @Test - @Ignore("Broke after update Coroutines, needs investigation") fun `when flow emits a state then flow observer calls listener`() { coVerify { flowListener(TurnstileState.Locked) } } @@ -54,12 +52,4 @@ class StateObserverTest { fun `when flow emits a state then custom observer calls listener`() { coVerify { customListener(TurnstileState.Locked) } } - - private suspend fun flowOnStateChanged(state: TurnstileState) { - // Do nothing - } - - private fun customOnStateChanged(state: TurnstileState) { - // Do nothing - } }