Begin using compiled code examples in the docs. See #781

This commit is contained in:
Peter Vlugter 2011-10-05 17:41:00 +02:00
parent 56f8f858be
commit 7884691d3a
14 changed files with 849 additions and 581 deletions

View file

@ -0,0 +1,27 @@
package akka.docs.stm
import org.scalatest.WordSpec
import org.scalatest.matchers.MustMatchers
class StmDocSpec extends WordSpec with MustMatchers {
"simple counter example" in {
//#simple
import akka.stm._
val ref = Ref(0)
def counter = atomic {
ref alter (_ + 1)
}
counter
// -> 1
counter
// -> 2
//#simple
ref.get must be === 2
}
}