This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a log entry detailing the repository status if it's found dirty (#56
- Loading branch information
Showing
2 changed files
with
93 additions
and
32 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
41 changes: 41 additions & 0 deletions
41
src/test/groovy/wooga/gradle/version/internal/SemVerStrategySpec.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 wooga.gradle.version.internal | ||
|
||
import org.ajoberstar.grgit.Status | ||
import spock.lang.Specification | ||
import wooga.gradle.version.internal.release.semver.SemVerStrategy | ||
|
||
class SemVerStrategySpec extends Specification { | ||
|
||
Map changes() { | ||
Map result = [:] | ||
result["added"] = [] | ||
result["modified"] = [] | ||
result["removed"] = [] | ||
result | ||
} | ||
|
||
def "generates status string"() { | ||
given: | ||
def args = [:] | ||
|
||
def staged = changes() | ||
staged["added"] = ["foo"] | ||
args["staged"] = staged | ||
|
||
def unstaged = changes() | ||
unstaged["removed"] = ["bar"] | ||
args["unstaged"] = unstaged | ||
|
||
def conflicts = [] | ||
args["conflicts"] = conflicts | ||
|
||
def status = new Status(args) | ||
|
||
when: | ||
def str = SemVerStrategy.composeRepositoryStatus(status) | ||
|
||
then: | ||
str.contains("[ADDED] foo") | ||
str.contains("[REMOVED] bar") | ||
} | ||
} |