~ prepare test for 404
authorAlexandre Bertails <bertails@w3.org>
Mon, 29 Aug 2011 16:36:00 -0400
changeset 26 c81f55f40e4c
parent 25 7896c3bfa468
child 27 c380c98da12f
~ prepare test for 404
src/test/scala/Test.scala
--- a/src/test/scala/Test.scala	Mon Aug 29 16:15:11 2011 -0400
+++ b/src/test/scala/Test.scala	Mon Aug 29 16:36:00 2011 -0400
@@ -24,8 +24,11 @@
   val joeBaseURI = baseURI(joe)
   val joeOnDisk = new File(base, "people/JoeLambda")
   
+  //base.deleteRecursively()
+
   doBeforeSpec {
-    base.deleteRecursively()
+    if (base.exists)
+      base.deleteRecursively()
     base.mkdir()
   }
   
@@ -49,6 +52,13 @@
   
   val initialModel = modelFromString(joeRDF, joeBaseURI)
 
+  "a GET on a URL that does not exist" should {
+    "return a 404" in {
+      val httpCode:Int = Http.when( _ => true)(joe get_statusCode)
+      httpCode must_== 404
+    }
+  }
+  
   "PUTing an RDF document on Joe's URI (which does not exist yet)" should {
     "return a 201" in {
       val httpCode:Int = Http(joe.put(joeRDF) get_statusCode)