I want to create few specifications that interoperate with database.
class DocumentSpec extends mutable.Specification with BeforeAfterExample {
sequential
d
If you want to run single Specification in specs2 sequentially just add sequential
method call at the beginning of your Specification. For example:
class MyTest extends Specification {
// Set sequential execution
sequential
// This tests will be executed sequentially
"my test" should {
"add numbers" in {
(1 + 1) should be equalTo 2
}
"multiply numbers" in {
(2 * 2) should be equalTo 4
}
}
}
UPDATE: As @jsears correctly mentioned in the comments, this will make tests to run sequentially in a single spec! Other specs may still run in parallel.