Commits

Pieter Joost van de Sande committed 79fc8d7

Introduce first 'green?' test

Comments (0)

Files changed (2)

 
 resolvers += "twitter-repo" at "http://maven.twttr.com"
 
-libraryDependencies ++= Seq("com.twitter" % "finagle-core" % "1.9.0", "com.twitter" % "finagle-http" % "1.9.0")
+libraryDependencies ++= Seq("com.twitter" % "finagle-core" % "1.9.0",
+                            "com.twitter" % "finagle-http" % "1.9.0",
+                            "org.scala-tools.testing" % "specs_2.9.1" % "1.6.9",
+                            "org.mockito" % "mockito-all" % "1.9.0")

src/main/scala/Web.scala

 import java.net.InetSocketAddress
 import util.Properties
 
+import org.specs._
 import org.specs.Specification
 import org.specs.mock.Mockito
+import org.mockito.Mockito._
+import scala.reflect.ClassManifest
 
 object Web {
   def main(args: Array[String]) {
 class WebTest extends Specification with Mockito {
   "Cities" should {
     "have content" in {
-      var request = mock(new HttpRequest)
+      var request = mock[HttpRequest]
 
-      var cities = Cities()
-      var f = cities.apply()
+      var cities = new Cities
+      var f = cities.apply(request)
 
       f onSuccess {
-        case response => reponse.getContent().readable() mustEqual true
+        case response => response.getContent().readable() mustEqual true
       }
     }
   }