Skip to content

Instantly share code, notes, and snippets.

@phaller
Created May 13, 2012 15:58
Show Gist options
  • Save phaller/2689041 to your computer and use it in GitHub Desktop.
Save phaller/2689041 to your computer and use it in GitHub Desktop.
Akka 2.0 TestKit specs2 template
package akka.training
import akka.testkit.{ TestKit, ImplicitSender }
import akka.actor.{ ActorSystem, Props }
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class ActorsSpec extends TestKit(ActorSystem()) with ImplicitSender with Specification {
"A ComputeActor" should {
"respond with the length of a string" in {
val computeActor = system.actorOf(Props[ComputeActor])
computeActor ! "Hello world"
expectMsg(11)
done
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment