-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added integration test that checks compatibility with different Gradl…
…e versions
- Loading branch information
1 parent
d86a47c
commit 079886c
Showing
2 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...st/groovy/org/unbrokendome/gradle/plugins/testsets/GradleVersionsCompatibilityTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.unbrokendome.gradle.plugins.testsets | ||
|
||
import org.gradle.testkit.runner.GradleRunner | ||
import org.gradle.testkit.runner.TaskOutcome | ||
import org.junit.Rule | ||
import org.junit.rules.TemporaryFolder | ||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
|
||
class GradleVersionsCompatibilityTest extends Specification { | ||
|
||
@Rule TemporaryFolder projectDir | ||
|
||
File buildFile | ||
|
||
|
||
def setup() { | ||
buildFile = projectDir.newFile('build.gradle') | ||
|
||
buildFile << ''' | ||
plugins { | ||
id 'org.unbroken-dome.test-sets' | ||
} | ||
testSets { | ||
integrationTest | ||
} | ||
''' | ||
} | ||
|
||
|
||
@Unroll | ||
def "Plugin should work in Gradle #gradleVersion"(String gradleVersion) { | ||
when: | ||
def result = GradleRunner.create() | ||
.withGradleVersion(gradleVersion) | ||
.withProjectDir(projectDir.root) | ||
.withPluginClasspath() | ||
.withArguments('integrationTest', '--stacktrace') | ||
.withDebug(true) | ||
.forwardOutput() | ||
.build() | ||
then: | ||
result.task(':integrationTest').outcome in [ TaskOutcome.NO_SOURCE, TaskOutcome.UP_TO_DATE ] | ||
|
||
where: | ||
gradleVersion << [ '4.0', '3.5', '3.3', '3.2.1', '2.14.1' ] | ||
} | ||
} |