From 74964489a5416437c79ea84e99d373beb4c44ffb Mon Sep 17 00:00:00 2001 From: Piotr Adamczyk Date: Wed, 22 Jul 2020 16:25:52 +0200 Subject: [PATCH] #884 added printing available locales for Android devices --- .../configuration/AndroidLocalesListCommandTest.kt | 11 +++++++++++ .../ios/configuration/IosLocalesListCommandTest.kt | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/configuration/AndroidLocalesListCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/configuration/AndroidLocalesListCommandTest.kt index 649f60ac52..3a952c6e23 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/configuration/AndroidLocalesListCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/android/configuration/AndroidLocalesListCommandTest.kt @@ -1,11 +1,22 @@ package ftl.cli.firebase.test.android.configuration import com.google.common.truth.Truth.assertThat +import ftl.android.AndroidCatalog +import io.mockk.mockkObject +import io.mockk.verify import org.junit.Test import picocli.CommandLine class AndroidLocalesListCommandTest { + @Test + fun `should execute AndroidCatalog localesAsTable when run AndroidLocalesListCommand`() { + mockkObject(AndroidCatalog) { + CommandLine(AndroidLocalesListCommand()).execute() + verify { AndroidCatalog.localesAsTable(any()) } + } + } + @Test fun androidLocalesListCommandShouldParseConfig() { val cmd = AndroidLocalesListCommand() diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/configuration/IosLocalesListCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/configuration/IosLocalesListCommandTest.kt index 4bdc516285..c73544dbdc 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/configuration/IosLocalesListCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/ios/configuration/IosLocalesListCommandTest.kt @@ -1,13 +1,24 @@ package ftl.cli.firebase.test.ios.configuration import com.google.common.truth.Truth +import ftl.ios.IosCatalog +import io.mockk.mockkObject +import io.mockk.verify import org.junit.Test import picocli.CommandLine class IosLocalesListCommandTest { @Test - fun androidLocalesListCommandShouldParseConfig() { + fun `should execute IosCatalog localesAsTable when run IosLocalesListCommand`() { + mockkObject(IosCatalog) { + CommandLine(IosLocalesListCommand()).execute() + verify { IosCatalog.localesAsTable(any()) } + } + } + + @Test + fun iOsLocalesListCommandShouldParseConfig() { val cmd = IosLocalesListCommand() CommandLine(cmd).parseArgs("--config=a")