spray-testkit:找不到参数ta的隐含值:

时间:2015-02-24 01:30:56

标签: scala spray spray-client spray-test

第一次将用户拉近撕开头发。

trait SampleService extends SimpleRoutingApp with JsonProtocol with SprayJsonSupport {

  implicit val system: ActorSystem = ActorSystem("test")

  implicit def context: ExecutionContext = system.dispatcher

  startServer(interface = "localhost", port = 8888) {
    path("test") { _ =>
      get {
        complete {
          "test"
        }
      }
    }
  }
}

import org.scalatest.FlatSpec import spray.testkit.ScalatestRouteTest

class ApiSpec extends FlatSpec with ScalatestRouteTest with SampleService {

  "The api service" should "return test" in {
    Get("/test/") ~> check {
      responseAs[String] === "test"
    }
  }
}

精彩的编译错误信息:

 could not find implicit value for parameter ta: ApiSpec.this.TildeArrow[ApiSpec.this.RouteResult,Boolean]
[error]     Get("/test/") ~> check {}

有谁能请我指出正确的方向?从spray-testkit示例复制粘贴似乎失败了。

0 个答案:

没有答案