Fix test in VersionFormatterTest (there was a swap in the test names by the way).
This commit is contained in:
parent
5e27c54deb
commit
33526db485
1 changed files with 16 additions and 10 deletions
|
|
@ -23,25 +23,31 @@ import kotlinx.coroutines.test.runTest
|
|||
import org.junit.Test
|
||||
|
||||
class VersionFormatterTest {
|
||||
@Test
|
||||
fun `version formatter should return simplified version for other branch`() = runTest {
|
||||
val sut = DefaultVersionFormatter(
|
||||
stringProvider = FakeStringProvider(defaultResult = VERSION),
|
||||
buildMeta = aBuildMeta(gitBranchName = "main")
|
||||
)
|
||||
assertThat(sut.get()).isEqualTo(VERSION)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `version formatter should return simplified version for main branch`() = runTest {
|
||||
val sut = DefaultVersionFormatter(
|
||||
stringProvider = FakeStringProvider(defaultResult = VERSION),
|
||||
buildMeta = aBuildMeta(
|
||||
gitBranchName = "main",
|
||||
versionName = "versionName",
|
||||
versionCode = 123
|
||||
)
|
||||
)
|
||||
assertThat(sut.get()).isEqualTo("${VERSION}versionName, 123")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `version formatter should return simplified version for other branch`() = runTest {
|
||||
val sut = DefaultVersionFormatter(
|
||||
stringProvider = FakeStringProvider(defaultResult = VERSION),
|
||||
buildMeta = aBuildMeta(
|
||||
versionName = "versionName",
|
||||
versionCode = 123,
|
||||
gitBranchName = "branch",
|
||||
gitRevision = "1234567890",
|
||||
)
|
||||
)
|
||||
assertThat(sut.get()).isEqualTo("$VERSION\nbranch (1234567890)")
|
||||
assertThat(sut.get()).isEqualTo("${VERSION}versionName, 123\nbranch (1234567890)")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue