-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fc45af
commit 3cfe7a9
Showing
3 changed files
with
31 additions
and
11 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
22 changes: 22 additions & 0 deletions
22
src/test/groovy/org/shipkit/changelog/GenerateChangelogTaskTest.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,22 @@ | ||
package org.shipkit.changelog | ||
|
||
import org.junit.Rule | ||
import org.junit.rules.TemporaryFolder | ||
import spock.lang.Specification | ||
|
||
import static org.shipkit.changelog.GenerateChangelogTask.provideGitDir | ||
|
||
class GenerateChangelogTaskTest extends Specification { | ||
|
||
@Rule TemporaryFolder tmp = new TemporaryFolder() | ||
|
||
def "getGitDir is safe"() { | ||
expect: | ||
provideGitDir(null) == null | ||
provideGitDir(new File("missing")) == null | ||
|
||
and: | ||
def gitDir = tmp.newFolder(".git") | ||
provideGitDir(gitDir.parentFile) == gitDir | ||
} | ||
} |