You can specify that the tests must execute sequentially by adding sequential
to your specification.
If you are using unit style testing, put the statement sequential
in a line above your tests (examples borrowed from specs docs):
import org.specs2.mutable._
class HelloWorldSpec extends Specification {
sequential
"The 'Hello world' string" should {
"contain 11 characters" in {
"Hello world" must have size(11)
}
"start with 'Hello'" in {
"Hello world" must startWith("Hello")
}
"end with 'world'" in {
"Hello world" must endWith("world")
}
}
}
If you are using acceptance style testing, just add sequential inside the definition of is
import org.specs2._
class HelloWorldSpec extends Specification { def is =
sequential ^
"This is a specification to check the 'Hello world' string" ^
p^
"The 'Hello world' string should" ^
"contain 11 characters" ! e1^
"start with 'Hello'" ! e2^
"end with 'world'" ! e3^
end
def e1 = "Hello world" must have size(11)
def e2 = "Hello world" must startWith("Hello")
def e3 = "Hello world" must endWith("world")
}
As a side note, you are probably getting the stack overflow errors from an error in your software, rather than the tests being too long.