From d9cba86579545c89fb8fd2f4233e65f1b1e54148 Mon Sep 17 00:00:00 2001 From: CalebK Date: Tue, 12 Nov 2024 13:07:51 +0300 Subject: [PATCH] Fix failing tests --- .../kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt index dadced942..eddc7840c 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/settings/StorageCalculatorTest.kt @@ -20,6 +20,7 @@ package org.kiwix.kiwixmobile.core.settings import io.mockk.every import io.mockk.mockk +import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import java.io.File @@ -37,14 +38,14 @@ internal class StorageCalculatorTest { } @Test - fun `calculate total space of existing file`() { + fun `calculate total space of existing file`() = runTest { every { file.totalSpace } returns 1 every { file.exists() } returns true assertThat(storageCalculator.calculateTotalSpace(file)).isEqualTo("1 Bytes") } @Test - fun `calculate total space of non existing file`() { + fun `calculate total space of non existing file`() = runTest { every { file.exists() } returns false assertThat(storageCalculator.calculateTotalSpace(file)).isEqualTo("0 Bytes") }