These are chat archives for etorreborre/specs2

27th
Oct 2016
Matthew de Detrich
@mdedetrich
Oct 27 2016 10:21
If you are using def is with import org.specs2.Specification, how can you specify scopes for your various specifications?
Eric Torreborre
@etorreborre
Oct 27 2016 10:22
I generally don't use scopes
Matthew de Detrich
@mdedetrich
Oct 27 2016 10:22
Is there an alternative? Essentially we need to set up data before each type of test is run.
Eric Torreborre
@etorreborre
Oct 27 2016 10:22
I just create the objects/services I need, or use ScalaCheck to get them
are the tests sharing this data, is it mutable?
Matthew de Detrich
@mdedetrich
Oct 27 2016 10:23
doesn’t that get a bit boilerplatery if you also end up needing stuff to clean up after?
Well they don’t have to, I actually want to restructure the tests so they don’t share the same data
So they can be run in parallel without conflicts
Eric Torreborre
@etorreborre
Oct 27 2016 10:24
hence my question about mutating. If you don't share you can just write
def test1 = {
   val data = createData
   data must beOK
}
or better
def test1 = prop { data: Data =>
   data must beOk 
}