class TVSetActorSpec extends AsyncFeatureSpec with GivenWhenThen { implicit override def executionContext = scala.concurrent.ExecutionContext.Implicits.global info("As a TV set owner") info("I want to be able to turn the TV on and off") info("So I can watch TV when I want") info("And save energy when I'm not watching TV") feature("TV power button") { scenario("User presses power button when TV is off") { Given("a TV set that is switched off") val tvSetActor = new TVSetActor When("the power button is pressed") tvSetActor ! PressPowerButton Then("the TV should switch on") val futureBoolean = tvSetActor ? IsOn futureBoolean map {
_ => myfunction()
} } scenario("User presses power button when TV is on") { Given("a TV set that is switched on") val tvSetActor = new TVSetActor tvSetActor ! PressPowerButton When("the power button is pressed") tvSetActor ! PressPowerButton Then("the TV should switch off") val futureBoolean = tvSetActor ? IsOn futureBoolean map {
_ => myfunction()
} } } }
def myfunction() = {
assert(assertion1)
assert(assertion2)
assert(assertion3)
}
--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalatest-users@googlegroups.com
To unsubscribe from this group, send email to
scalatest-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.