Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created May 15, 2015 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjazdzewski1990/dd12c380ac736a5c876c to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/dd12c380ac736a5c876c to your computer and use it in GitHub Desktop.
import org.specs2.mutable.Specification
import org.specs2.specification.{Step, Fragments}
trait BeforeAllAfterAll extends Specification {
override def map(fragments: => Fragments) =
Step(beforeAll) ^ fragments ^ Step(afterAll)
protected def beforeAll()
protected def afterAll()
}
class MathSpec extends Specification with BeforeAllAfterAll {
def beforeAll() {
println("Starting MathSpec")
}
def afterAll() {
println("Ending MathSpec")
}
"Math" should {
"divide" in {
8/2 === 4
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment