git tests: kotlinify

This commit is contained in:
Kirill Likhodedov
2018-05-17 12:17:01 +03:00
parent 634af090fe
commit 20ff37e89b
@@ -253,7 +253,7 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
val log = git("log -3 --pretty=%H#%s")
val commits = StringUtil.splitByLines(log)
val lastCommitMsg = commits[0].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[1]
assertTrue("The last commit doesn't look like a merge commit: " + lastCommitMsg, lastCommitMsg.contains("Merge"))
assertTrue("The last commit doesn't look like a merge commit: $lastCommitMsg", lastCommitMsg.contains("Merge"))
assertEquals(hash, commits[1].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0])
assertEquals(broHash, commits[2].split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()[0])
@@ -392,13 +392,13 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
})
push("master", "origin/master")
assertTrue("Default action in rejected-push dialog is incorrect: " + defaultActionName,
defaultActionName.toLowerCase().contains("rebase"))
assertTrue("Default action in rejected-push dialog is incorrect: $defaultActionName",
defaultActionName.toLowerCase().contains("rebase"))
git("config branch.master.rebase false")
push("master", "origin/master")
assertTrue("Default action in rejected-push dialog is incorrect: " + defaultActionName,
defaultActionName.toLowerCase().contains("merge"))
assertTrue("Default action in rejected-push dialog is incorrect: $defaultActionName",
defaultActionName.toLowerCase().contains("merge"))
}
fun `test respect branch default setting for silent update when rejected push`() {
@@ -487,7 +487,7 @@ class GitPushOperationSingleRepoTest : GitPushOperationBaseTest() {
private fun assertPushed(expectedHash: String, branch: String) {
Executor.cd(parentRepo.path)
val actualHash = git("log -1 --pretty=%H " + branch)
val actualHash = git("log -1 --pretty=%H $branch")
assertEquals(expectedHash, actualHash)
}