File tree 3 files changed +32
-25
lines changed
src/test/groovy/com/github/jk1/license
3 files changed +32
-25
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,7 @@ class MultiProjectReportCachingSpec extends Specification {
75
75
"""
76
76
77
77
78
- BuildResult result = GradleRunner . create()
79
- .withPluginClasspath()
80
- .withProjectDir(testProjectDir)
81
- .withArguments(' --build-cache' , " generateLicenseReport" )
82
- .build()
78
+ BuildResult result = runBuild()
83
79
84
80
then :
85
81
result. task(' :generateLicenseReport' ). outcome == TaskOutcome . SUCCESS
@@ -91,13 +87,19 @@ class MultiProjectReportCachingSpec extends Specification {
91
87
}
92
88
"""
93
89
94
- result = GradleRunner . create()
95
- .withPluginClasspath()
96
- .withProjectDir(testProjectDir)
97
- .withArguments(' --build-cache' , " generateLicenseReport" )
98
- .build()
90
+ result = runBuild()
99
91
100
92
then :
101
93
result. task(' :generateLicenseReport' ). outcome == TaskOutcome . SUCCESS
102
94
}
95
+
96
+ private BuildResult runBuild () {
97
+ return GradleRunner . create()
98
+ .withPluginClasspath()
99
+ .withProjectDir(testProjectDir)
100
+ .withArguments(' --build-cache' , " generateLicenseReport" )
101
+ .withDebug(true )
102
+ .forwardOutput()
103
+ .build()
104
+ }
103
105
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import static com.github.jk1.license.AbstractGradleRunnerFunctionalSpec.fixPathF
28
28
class PluginSpec extends Specification {
29
29
30
30
private final static def supportedGradleVersions = [" 7.6.1" , " 8.1.1" ]
31
- private final static def unsupportedGradleVersions = [ " 5.6" , " 6.8.2" ]
31
+ private final static def unsupportedGradleVersions = [" 5.6" , " 6.8.2" ]
32
32
33
33
@TempDir
34
34
File testProjectDir
@@ -142,11 +142,12 @@ class PluginSpec extends Specification {
142
142
143
143
private def runGradle(String gradleVersion) {
144
144
GradleRunner.create()
145
- .withGradleVersion(gradleVersion)
146
- .withProjectDir(testProjectDir)
147
- .withArguments(" generateLicenseReport" , " -- info" , " -- stacktrace" )
148
- .withPluginClasspath()
149
- .forwardOutput()
150
- .build()
145
+ .withGradleVersion(gradleVersion)
146
+ .withProjectDir(testProjectDir)
147
+ .withArguments(" generateLicenseReport" , " -- info" , " -- stacktrace" )
148
+ .withPluginClasspath()
149
+ .withDebug(true)
150
+ .forwardOutput()
151
+ .build()
151
152
}
152
153
}
Original file line number Diff line number Diff line change @@ -33,18 +33,22 @@ class CheckLicenseTaskSpec extends Specification {
33
33
34
34
BuildResult result (String [] arguments ) {
35
35
return GradleRunner . create()
36
- .withPluginClasspath()
37
- .withProjectDir(testProjectDir)
38
- .withArguments(arguments)
39
- .build()
36
+ .withPluginClasspath()
37
+ .withProjectDir(testProjectDir)
38
+ .withArguments(arguments)
39
+ .withDebug(true )
40
+ .forwardOutput()
41
+ .build()
40
42
}
41
43
42
44
BuildResult failResult (String [] arguments ) {
43
45
return GradleRunner . create()
44
- .withPluginClasspath()
45
- .withProjectDir(testProjectDir)
46
- .withArguments(arguments)
47
- .buildAndFail()
46
+ .withPluginClasspath()
47
+ .withProjectDir(testProjectDir)
48
+ .withArguments(arguments)
49
+ .withDebug(true )
50
+ .forwardOutput()
51
+ .buildAndFail()
48
52
}
49
53
50
54
def setup () {
You can’t perform that action at this time.
0 commit comments