-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'classpath(...)' test suite feature
Resolves #47
- Loading branch information
Showing
5 changed files
with
93 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
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
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
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
30 changes: 30 additions & 0 deletions
30
src/test/groovy/org/gradlex/javamodule/testing/test/ClasspathSuiteTest.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,30 @@ | ||
package org.gradlex.javamodule.testing.test | ||
|
||
import org.gradle.testkit.runner.TaskOutcome | ||
import org.gradlex.javamodule.testing.test.fixture.GradleBuild | ||
import spock.lang.Specification | ||
|
||
class ClasspathSuiteTest extends Specification { | ||
|
||
@Delegate | ||
GradleBuild build = new GradleBuild() | ||
|
||
def "can configure classpath test suite"() { | ||
given: | ||
appBuildFile << ''' | ||
javaModuleTesting.classpath(testing.suites["test"]) | ||
''' | ||
appModuleInfoFile << ''' | ||
module org.example.app { | ||
} | ||
''' | ||
|
||
when: | ||
def result = runTests() | ||
|
||
then: | ||
result.output.contains('Main Module: null') | ||
result.output.contains('Test Module: null') | ||
result.task(':app:test').outcome == TaskOutcome.SUCCESS | ||
} | ||
} |