Skip to content

Commit

Permalink
Ignore certain tests incompatible with Java 11
Browse files Browse the repository at this point in the history
These rely on setting user.dir, which isn't supported on Java 11
  • Loading branch information
ajoberstar committed Mar 23, 2019
1 parent eafe6a0 commit 1ead473
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.ajoberstar.grgit.operation

import org.ajoberstar.grgit.Credentials
import spock.lang.IgnoreIf

import java.nio.file.Files

Expand Down Expand Up @@ -42,6 +43,7 @@ class OpenOpSpec extends SimpleGitOpSpec {
}

@RestoreSystemProperties
@IgnoreIf({ Integer.parseInt(System.properties['java.version'].split('\\.')[0]) >= 11})
def 'open without dir fails if there is no repo in the current dir'() {
given:
File workingDir = tempDir.newFolder('no_repo')
Expand All @@ -53,6 +55,7 @@ class OpenOpSpec extends SimpleGitOpSpec {
}

@RestoreSystemProperties
@IgnoreIf({ Integer.parseInt(System.properties['java.version'].split('\\.')[0]) >= 11})
def 'open without dir succeeds if current directory is repo dir'() {
given:
File dir = repoDir('.')
Expand All @@ -67,6 +70,7 @@ class OpenOpSpec extends SimpleGitOpSpec {
}

@RestoreSystemProperties
@IgnoreIf({ Integer.parseInt(System.properties['java.version'].split('\\.')[0]) >= 11})
def 'open without dir succeeds if current directory is subdir of a repo'() {
given:
System.setProperty('user.dir', subdir.absolutePath)
Expand All @@ -79,6 +83,7 @@ class OpenOpSpec extends SimpleGitOpSpec {
}

@RestoreSystemProperties
@IgnoreIf({ Integer.parseInt(System.properties['java.version'].split('\\.')[0]) >= 11})
def 'open without dir succeeds if .git in current dir has gitdir'() {
given:
File workDir = tempDir.newFolder()
Expand All @@ -100,6 +105,7 @@ class OpenOpSpec extends SimpleGitOpSpec {
}

@RestoreSystemProperties
@IgnoreIf({ Integer.parseInt(System.properties['java.version'].split('\\.')[0]) >= 11})
def 'open without dir succeeds if .git in parent dir has gitdir'() {
given:
File workDir = tempDir.newFolder()
Expand Down

0 comments on commit 1ead473

Please sign in to comment.