Merge pull request #22800 from akka/TypedSpecSpecStopActorSystem

Stop adapted actorsystem after running TypedSpec (#22763)
This commit is contained in:
Patrik Nordwall 2017-04-27 10:58:34 +02:00 committed by GitHub
commit 7c814fd20a

View file

@ -57,7 +57,7 @@ abstract class TypedSpec(val config: Config) extends TypedSpecSetup {
private var adaptedSystemUsed = false
lazy val adaptedSystem: ActorSystem[TypedSpec.Command] = {
val sys = ActorSystem.adapter(AkkaSpec.getCallerName(classOf[TypedSpec]), guardian(), config = Some(config withFallback AkkaSpec.testConf))
adaptedSystemUsed = false
adaptedSystemUsed = true
sys
}
@ -202,13 +202,15 @@ class TypedSpecSpec extends TypedSpec {
object `A TypedSpec` {
trait CommonTests {
class MyException(message: String) extends Exception(message)
implicit def system: ActorSystem[TypedSpec.Command]
def `must report failures`(): Unit = {
a[TestFailedException] must be thrownBy {
a[MyException] must be thrownBy {
sync(runTest("failure")(StepWise[String]((ctx, startWith)
startWith {
fail("expected")
throw new MyException("expected")
})))
}
}