~ use temp dir for tests
authorAlexandre Bertails <bertails@gmail.com>
Sun, 28 Aug 2011 22:08:27 -0400
changeset 18 d43e2e3bbbfe
parent 17 a0e1740a7ea8
child 19 0dbf1797f1b8
~ use temp dir for tests
src/test/scala/Test.scala
--- a/src/test/scala/Test.scala	Sun Aug 28 18:46:03 2011 -0400
+++ b/src/test/scala/Test.scala	Sun Aug 28 22:08:27 2011 -0400
@@ -18,13 +18,14 @@
 
 object ReadWriteWebSpec extends Specification with unfiltered.spec.jetty.Served {
 
-  val base = new File("src/main/resources")
+  val base = new File(new File(System.getProperty("java.io.tmpdir")), "readwriteweb")
   val joe = host / "2007/wiki/people/JoeLambda"
   val baseURI = "%s%s" format (joe.host, joe.path)
   val joeOnDisk = new File(base, "2007/wiki/people/JoeLambda")
   
   doBeforeSpec {
-    if (joeOnDisk.exists) joeOnDisk.delete()    
+    if (joeOnDisk.exists) joeOnDisk.delete()   
+    if (! base.exists) base.mkdir()
   }
   
   doAfterSpec {