-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes error when working on project without Git repository
- Loading branch information
1 parent
d41f06c
commit 59b1017
Showing
6 changed files
with
60 additions
and
12 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...tegration/groovy/pl/allegro/tech/build/axion/release/RepositorylessIntegrationTest.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,41 @@ | ||
package pl.allegro.tech.build.axion.release | ||
|
||
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 | ||
|
||
class RepositorylessIntegrationTest extends Specification { | ||
|
||
@Rule | ||
TemporaryFolder temporaryFolder = new TemporaryFolder() | ||
|
||
File directory | ||
|
||
void setup() { | ||
directory = temporaryFolder.root | ||
} | ||
|
||
def "should not fail build when calling currentVersion task on project without repo"() { | ||
given: | ||
File build = temporaryFolder.newFile('build.gradle') | ||
build << """ | ||
plugins { | ||
id 'pl.allegro.tech.build.axion-release' | ||
} | ||
project.version = scmVersion.version | ||
""" | ||
|
||
when: | ||
def result = GradleRunner.create() | ||
.withProjectDir(directory) | ||
.withPluginClasspath() | ||
.withArguments('currentVersion', '-s') | ||
.build() | ||
|
||
then: | ||
result.task(":currentVersion").outcome == TaskOutcome.SUCCESS | ||
} | ||
} |
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
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