Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
// Copyright © 2010-2016, Esko Luontola <>
// This software is released under the Apache License 2.0.
// The license text is at
package org.specsy.examples.scala
import org.specsy.scala.ScalaSpecsy
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers._
class ShareSideEffectsExampleSpec extends ScalaSpecsy {
var counter = 0
// Without the call to `shareSideEffects()` the value of `counter` would be `1`
// in the asserts of each of the following child specs.
"One" >> {
counter += 1
assertThat(counter, is(1))
"Two" >> {
counter += 1
assertThat(counter, is(2))
"Three" >> {
counter += 1
assertThat(counter, is(3))