Skip to content

Commit

Permalink
Merge pull request #81 from rspieldenner/testkit
Browse files Browse the repository at this point in the history
Use testkit way to lookup plugin classpath
  • Loading branch information
rspieldenner authored Mar 2, 2017
2 parents ea138f3 + 5a4efd3 commit f1fbd05
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 60 deletions.
21 changes: 1 addition & 20 deletions src/main/groovy/nebula/test/IntegrationTestKitSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ abstract class IntegrationTestKitSpec extends BaseIntegrationSpec {
def setup() {
settingsFile = new File(projectDir, "settings.gradle")
buildFile = new File(projectDir, "build.gradle")

configurePluginClasspath()
}

def configurePluginClasspath() {
def pluginClasspathResource = this.class.classLoader.findResource("plugin-classpath.txt")
if (pluginClasspathResource == null) {
throw new IllegalStateException("Did not find plugin classpath resource, run `testClasses` build task.")
}
def pluginClasspath = pluginClasspathResource.readLines()
.collect { it.replace("\\", "\\\\") } // escape backslashes in Windows paths
.collect { "'$it'" }
.join(", ")
buildFile << """\
buildscript {
dependencies {
classpath files($pluginClasspath)
}
}
""".stripIndent()
}

def cleanup() {
Expand All @@ -69,6 +49,7 @@ abstract class IntegrationTestKitSpec extends BaseIntegrationSpec {
GradleRunner.create()
.withProjectDir(projectDir)
.withArguments(*tasks.plus("-i"))
.withPluginClasspath()
.forwardOutput()
.build()
}
Expand Down
40 changes: 0 additions & 40 deletions src/test/groovy/nebula/test/ConcreteIntegrationTestKitSpec.groovy

This file was deleted.

0 comments on commit f1fbd05

Please sign in to comment.