Fix hashtag
This commit is contained in:
parent
04805f3a57
commit
5306a40503
3 changed files with 23 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
})
|
Loading…
Reference in a new issue