1

how would one declare dependencies in Spec2 (Unit-Style)?

Example:

object MySpec extends Specification {
  firstDo MyOtherSpec
}

So MyOtherSpec's test execute before MySpec's tests!

Tim Joseph
  • 817
  • 1
  • 13
  • 27

1 Answers1

1

In general, that might not be a good idea. The purpose of Unit tests is that they test small, encapsulated units. The need to run them sequentially is not only a waste of resources (parallel computation), but also points to potential problems in encapsulation.

Nevertheless, inside a specification you can put intermediate steps to be completed. Execution will be in parallel for all definition before a step, then for all after, but steps are completed in order. Check this and this for relevant documentation.

Daniel Langdon
  • 5,607
  • 4
  • 24
  • 47