Specs2 specifications and matchers for akka-testkit
HEALTH ? 88 / Healthy
Specs2 specifications and matchers for akka-testkit
// readme
A small library for those who use akka-testkit in specs2 specifications. Provides idiomatic specs2 matchers for checking the correct reception of messages by test actors and probes, handling the provision and proper termination of test actor systems.
To use akka-testkit-specs2 in an existing SBT project with Scala 2.13 or 3.2, add the following dependency to your build.sbt:
libraryDependencies += "net.ruippeixotog" %% "akka-testkit-specs2" % "0.4.1"
To use it in your specifications, just extend AkkaSpecification:
class MySpec extends AkkaSpecification {
"MySpec" should {
"provide a test actor and matchers for messages" in {
testActor ! "hello"
this must receive("hello")
}
}
}
If you canβt extend classes in your specification, just mix-in the trait AkkaSpecificationLike (you just need to provide it an ActorSystem). If you only need the matchers, you canβ¦