Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 5, 2014 22:47
Show Gist options
  • Save chbatey/8834924 to your computer and use it in GitHub Desktop.
Save chbatey/8834924 to your computer and use it in GitHub Desktop.
Testing a message sent to a child
class ParentActorTest extends TestKit(ActorSystem("TestSystem")) with FunSuiteLike {
test("Should delegate the important work to the client") {
val testProbeForChild = TestProbe()
val underTest = TestActorRef(new ParentActor(_ => testProbeForChild.ref))
underTest ! "Go do some work"
testProbeForChild.expectMsg("Go and do something important!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment