add extractActorSystem directive (#21097)

This commit is contained in:
Hawstein 2016-08-16 20:59:05 +08:00 committed by Konrad Malawski
parent 07c6332a22
commit 3e2bdb55a3
8 changed files with 96 additions and 2 deletions

View file

@ -862,4 +862,17 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
//#
}
"extractActorSystem-example" in {
//#extractActorSystem-example
val route = extractActorSystem { actorSystem =>
complete(s"Actor System extracted, hash=${actorSystem.hashCode()}")
}
// tests:
Get("/") ~> route ~> check {
responseAs[String] shouldEqual s"Actor System extracted, hash=${system.hashCode()}"
}
//#
}
}