Skip to content

Commit

Permalink
Added extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
amv-bamboo committed Apr 22, 2024
1 parent aa97bb0 commit daa9679
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ class GitHookPluginFunctionalTest {
gitHooks {
gitHooksDirectory = project.layout.projectDirectory.dir("${gitHooksDir.path}")
gitDirectory = project.layout.projectDirectory.dir(".git")
}
""".trimIndent()
)

// Run the build
val runner = GradleRunner.create()
runner.forwardOutput()
runner.withPluginClasspath()
runner.withArguments("installGitHooks")
runner.withProjectDir(projectDir)
val result = runner.build()

// Verify the result
assertEquals(
TaskOutcome.SUCCESS,
result.task(":installGitHooks")?.outcome
)
assertTrue {
gitHooksDestinationDir.exists()
}
}

@Test
fun `use convention`() {
gitHooksDir.mkdir()
// Set up the test build
settingsFile.writeText("")
buildFile.writeText(
"""
plugins {
id('eu.bambooapps.gradle.plugin.githook')
}
""".trimIndent()
)
Expand Down

0 comments on commit daa9679

Please sign in to comment.