For specs2 tests, we can use object
or class
to contain tests:
object MyTests extends Specification
class MyTests extends Specification
But if I want to use isolated
, must I use class
?
class MyTests extends Specification {
isolated
}
I ask this because I found, when I use object
, the tests sometimes reports an error:
NoSuchElementException: : head of empty list (file:1)
But it disappeared when I change to class
This is indeed a bug with the version of specs2 which you are using. This part has been re-implemented in specs2 3.x and is working fine.