diff --git a/app/src/main/kotlin/de/rpr/githubreleases/model/GithubRepo.kt b/app/src/main/kotlin/de/rpr/githubreleases/model/GithubRepo.kt index 507fe8c..9726c3d 100644 --- a/app/src/main/kotlin/de/rpr/githubreleases/model/GithubRepo.kt +++ b/app/src/main/kotlin/de/rpr/githubreleases/model/GithubRepo.kt @@ -16,7 +16,10 @@ data class GithubRepo( name = repoPath.substring(usernameEnd + 1).trimEnd { ch -> ch == '/' } } - @Transient val capitalizedName = name.replaceFirstChar { it.uppercase() } + @Transient val capitalizedName = + name + .split("-", "_", ".", ";", "+") + .joinToString("") { part -> part.replaceFirstChar { it.uppercase() } } val url = urlPrefix + repoPath diff --git a/app/src/main/kotlin/de/rpr/githubreleases/publishing/Publisher.kt b/app/src/main/kotlin/de/rpr/githubreleases/publishing/Publisher.kt index 6611128..1f313e4 100644 --- a/app/src/main/kotlin/de/rpr/githubreleases/publishing/Publisher.kt +++ b/app/src/main/kotlin/de/rpr/githubreleases/publishing/Publisher.kt @@ -29,7 +29,7 @@ class Publisher( if (!dryRun) { request.execute() } else { - log("Dry-Run, skipping publishing of events...") + log("Dry-Run, skipping publishing of event...") } return@mapNotNull release } catch (ex: BigBoneRequestException) { diff --git a/app/src/test/kotlin/de/rpr/githubreleases/model/GithubRepoTest.kt b/app/src/test/kotlin/de/rpr/githubreleases/model/GithubRepoTest.kt new file mode 100644 index 0000000..81998d8 --- /dev/null +++ b/app/src/test/kotlin/de/rpr/githubreleases/model/GithubRepoTest.kt @@ -0,0 +1,18 @@ +package de.rpr.githubreleases.model + +import assertk.assertThat +import assertk.assertions.isEqualTo +import io.kotest.core.spec.style.DescribeSpec + +class GithubRepoTest : DescribeSpec({ + + describe("GithubRepo") { + + it("capitalizedName should be correct") { + assertThat(GithubRepo("test/test-one").capitalizedName).isEqualTo("TestOne") + assertThat(GithubRepo("test/test.one").capitalizedName).isEqualTo("TestOne") + assertThat(GithubRepo("test/test+one").capitalizedName).isEqualTo("TestOne") + assertThat(GithubRepo("test/test;one").capitalizedName).isEqualTo("TestOne") + } + } +})