-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PredefinedSnapshotCreator: unclean snapshot (#544)
* ScmPosition: added isClean * PredefinedSnapshotCreator: -unclean-SNAPSHOT * added @input to new method getIsClean()
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
...st/groovy/pl/allegro/tech/build/axion/release/domain/PredefinedSnapshotCreatorTest.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,23 @@ | ||
package pl.allegro.tech.build.axion.release.domain | ||
|
||
import spock.lang.Specification | ||
|
||
import static pl.allegro.tech.build.axion.release.domain.scm.ScmPositionBuilder.scmPosition | ||
|
||
class PredefinedSnapshotCreatorTest extends Specification { | ||
|
||
def "default snapshot creator should just return -SNAPSHOT"() { | ||
expect: | ||
PredefinedSnapshotCreator.SIMPLE.snapshotCreator.apply('version', scmPosition('master')) == '-SNAPSHOT' | ||
} | ||
|
||
def "unclean snapshot creator should just return -SNAPSHOT when scm is clean"() { | ||
expect: | ||
PredefinedSnapshotCreator.UNCLEAN.snapshotCreator.apply('version', scmPosition('master')) == '-SNAPSHOT' | ||
} | ||
|
||
def "unclean snapshot creator should return -unclean-SNAPSHOT when scm is NOT clean"() { | ||
expect: | ||
PredefinedSnapshotCreator.UNCLEAN.snapshotCreator.apply('version', scmPosition().withBranch('master').withUnclean().build()) == '-unclean-SNAPSHOT' | ||
} | ||
} |