Merge pull request #22800 from akka/TypedSpecSpecStopActorSystem
Stop adapted actorsystem after running TypedSpec (#22763)
This commit is contained in:
commit
7c814fd20a
1 changed files with 5 additions and 3 deletions
|
|
@ -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")
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue