Skip to content

Commit

Permalink
Added test for old Gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr committed Jul 18, 2015
1 parent d889081 commit a6b74ca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class AbstractIntegrationSpec extends Specification {
}

Process gradle(Map<String, ?> options, List<?> arguments, Closure check = null) {
def commandLine = ["$rootDir/gradlew", *arguments]
def gradlewDir = options.gradlewDir ?: options.workingDir ?: dir
def commandLine = ["$gradlewDir/gradlew", *arguments]
exec options, commandLine, check
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ package com.prezi.pride.test
class PrideInitIntegrationTest extends AbstractIntegrationSpec {
def "pride init"() {
given:
exec workingDir: "git-module", "git", "init"
exec workingDir: "git-module", "git", "config", "user.email", "[email protected]"
exec workingDir: "git-module", "git", "config", "user.name", "Test User"
exec workingDir: "git-module", "git", "add", "-A"
exec workingDir: "git-module", "git", "commit", "--message", "Initial"
exec workingDir: "git-module", "git", "remote", "add", "origin", "[email protected]:prezi/test"
setupModules()

when:
pride "init", "--gradle-version", defaultGradleVersion
Expand Down Expand Up @@ -70,4 +65,26 @@ modules.0.vcs = git
""")

}

def "using with earlier Gradle versions produces error"() {
given:
setupModules()
pride "init", "--gradle-version", "2.4"

expect:
gradle(["tasks"]) { Process process ->
assert process.err.text.contains("""Pride requires Gradle version 2.5 or later. If you want to use an earlier Gradle version, try Pride 0.10.""")
process.waitForProcessOutput()
assert process.exitValue() != 0
}
}

def setupModules() {
exec workingDir: "git-module", "git", "init"
exec workingDir: "git-module", "git", "config", "user.email", "[email protected]"
exec workingDir: "git-module", "git", "config", "user.name", "Test User"
exec workingDir: "git-module", "git", "add", "-A"
exec workingDir: "git-module", "git", "commit", "--message", "Initial"
exec workingDir: "git-module", "git", "remote", "add", "origin", "[email protected]:prezi/test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class TransitiveResolutionIntegrationTest extends AbstractIntegrationSpec {
def moduleBDir = file("module-b")

FileUtils.forceMkdir repoDir
gradle workingDir: moduleADir, "uploadArchives"
gradle workingDir: moduleBDir, "uploadArchives"
gradle gradlewDir: rootDir, workingDir: moduleADir, "uploadArchives"
gradle gradlewDir: rootDir, workingDir: moduleBDir, "uploadArchives"
pride workingDir: prideDir, "init", "-v", "--gradle-version", defaultGradleVersion

expect:
Expand Down

0 comments on commit a6b74ca

Please sign in to comment.