Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 11, 2014 02:40
Show Gist options
  • Save chbatey/8928367 to your computer and use it in GitHub Desktop.
Save chbatey/8928367 to your computer and use it in GitHub Desktop.
Akka: Testing a message sent to an actor's parent
class ChildActorTest extends TestKit(ActorSystem("ChildActorTest")) with FunSuiteLike with ShouldMatchers {
test("Should inform parent when told to do something") {
val parent = TestProbe()
val underTest = TestActorRef(Props[ChildActor], parent.ref, "ChildActor")
underTest ! "Do something"
parent.expectMsg("I was told to do something and I did it")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment