Created
May 13, 2012 15:58
-
-
Save phaller/2689041 to your computer and use it in GitHub Desktop.
Akka 2.0 TestKit specs2 template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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