Skip to content

Commit

Permalink
#73 Remove unnecessary tests that are not correctly working
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhauck committed Jan 28, 2025
1 parent 4d00343 commit d7c040b
Showing 1 changed file with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,55 +117,4 @@ internal class PushTaskTest {
assertThat(actual).isEqualTo(TaskOutcome.SUCCESS)
}

@Test
fun `should be successful when specifying an ssh key`() =
testDriver(tmpDir) {
val sshKeyFile = getTestResourceFile("ssh-key/id_rsa")

createValidRepositoryWithRemote()

val absolutePath = sshKeyFile.canonicalFile.absolutePath.replace("\\", "\\\\")
appendContentToBuildGradle(
"""
|tasks.register<PushTask>("testPush"){
| sshKeyFile = file("$absolutePath")
|}
"""
.trimMargin()
)
client1Api.add("build.gradle.kts")
client1Api.commit("pushTaskMessage")

val runner = testKitRunner().withArguments("testPush").build()

val actual = runner.task(":testPush")?.outcome
assertThat(actual).isEqualTo(TaskOutcome.SUCCESS)
}

@Test
fun `should be successful when specifying an ssh key with a whitespace in the folder name`() =
testDriver(tmpDir) {
val sshKeyFolder = tmpDir.resolve("folder with whitespaces/id_rsa")
val sshKeyFile = getTestResourceFile("ssh-key/id_rsa").copyTo(sshKeyFolder)

createValidRepositoryWithRemote()

val absolutePath = sshKeyFile.canonicalFile.absolutePath.replace("\\", "\\\\")

appendContentToBuildGradle(
"""
|tasks.register<PushTask>("testPush"){
| sshKeyFile = file("$absolutePath")
|}
"""
.trimMargin()
)
client1Api.add("build.gradle.kts")
client1Api.commit("pushTaskMessage")

val runner = testKitRunner().withArguments("testPush").build()

val actual = runner.task(":testPush")?.outcome
assertThat(actual).isEqualTo(TaskOutcome.SUCCESS)
}
}

0 comments on commit d7c040b

Please sign in to comment.