I have two abstract class that looks as follow:
abstract class BddAsyncSpec extends AsyncFeatureSpec
with Matchers
with GivenWhenThen
with BeforeAndAfter
with BeforeAndAfterAll
abstract class BddSpec extends FeatureSpec
with Matchers
with GivenWhenThen
with BeforeAndAfter
with BeforeAndAfterAll
as you can see, the mixin part looks the same. My question is, how to abstract the mixin part, that when I add more trait, then it applies for BddAsyncSpec and BddSpec.
Try
where we use self-type
because, for example,
GivenWhenThenrequiresInformingand
BeforeAndAfterandBeforeAndAfterAllrequireSuiteSelf-types are a way of specifying what the trait requires in order to be mixed-in.