Skip to content

Commit

Permalink
test: Add tests for optional build file features
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei committed Nov 11, 2024
1 parent 093b84c commit fad7db8
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,33 @@ class GradleSpec extends ApplicationContextSpec implements CommandOutputFixture
expect:
settingsGradle.contains("rootProject.name")
}

void "test buildSrc/build.gradle"() {
given:
def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["gradle-build-src"])
String buildSrcGradle = output["buildSrc/build.gradle"]

expect:
buildSrcGradle
buildSrcGradle.contains('repositories')
buildSrcGradle.contains('dependencies')
}

void "no settings.gradle file is created without the 'gradle-settings-file' feature"() {
given:
def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11))
String settingsGradle = output["settings.gradle"]

expect:
!settingsGradle
}

void "no buildSrc/build.gradle file is created without the 'gradle-build-src' feature"() {
given:
def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11))
String buildSrcGradle = output["buildSrc/settings.gradle"]

expect:
!buildSrcGradle
}
}

0 comments on commit fad7db8

Please sign in to comment.