Skip to content

Commit

Permalink
Add a test to ensure creating folders and jobs in separate files works
Browse files Browse the repository at this point in the history
  • Loading branch information
mnonnenmacher committed Feb 7, 2018
1 parent c21a34d commit 1ccc493
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ class GenerateXmlTest extends AbstractTaskTest {
new File(testProjectDir.root, 'build/jobdsl/xml/folder/job.xml').file
}

def 'creating job and folder in separate files works'() {
given:
buildFile << readBuildGradle('generateXml/build.gradle')
testProjectDir.newFolder('src', 'jobdsl', 'folder')
copyResourceToTestDir('generateXml/job-in-folder-without-folder.groovy', 'src/jobdsl/folder/job.groovy')
copyResourceToTestDir('generateXml/folder.groovy', 'src/jobdsl/folder.groovy')

when:
def result = gradleRunner
.withArguments('dslGenerateXml', '--stacktrace')
.build()

then:
result.task(':dslGenerateXml').outcome == TaskOutcome.SUCCESS

new File(testProjectDir.root, 'build/jobdsl/xml/folder.xml').file
new File(testProjectDir.root, 'build/jobdsl/xml/folder/job.xml').file
}

def 'filter applies to folders'() {
given:
buildFile << readBuildGradle('generateXml/build.gradle')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
freeStyleJob('folder/job')

0 comments on commit 1ccc493

Please sign in to comment.