Properly delete directories while on test teardown

This commit is contained in:
R. Tyler Croy 2015-08-21 17:57:21 -07:00
parent 963ed7c59e
commit 53d6dfed39
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 5 additions and 4 deletions

View File

@ -36,9 +36,10 @@ dependencies {
compile "org.jboss.shrinkwrap:shrinkwrap-bom:1.2.2"
compile "org.jboss.shrinkwrap:shrinkwrap-depchain:1.2.2"
/* Used for FileUtils and deleting integration test dirs */
testCompile 'org.apache.commons:commons-io:1.3.2'
testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
testCompile 'org.apache.commons:commons-io:1.3.2+'
}
test {

View File

@ -15,7 +15,6 @@ import com.github.jrubygradle.jem.Gem;
import com.github.jrubygradle.jem.GemInstaller.DuplicateBehavior;
import java.io.*;
import java.nio.file.Files;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;

View File

@ -6,6 +6,8 @@ import spock.lang.*
import java.nio.file.Files
import java.nio.file.Path
import org.apache.commons.io.FileUtils
class GemInstallerSpec extends Specification {
static final String FIXTURES_ROOT = new File(['src', 'test', 'resources'].join(File.separator)).absolutePath
@ -112,8 +114,7 @@ class GemInstallerIntegrationSpec extends Specification {
File dir = new File(installDir)
if (dir.exists() && dir.absolutePath.startsWith('/tmp')) {
println dir
//FileUtils.deleteDirectory(dir)
FileUtils.deleteDirectory(dir)
}
}