第一次喷雾用户接近抓取头发。
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"
}
}
}
}
}
进口org.scalatest.FlatSpec进口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
例子似乎失败。