Hi I am trying to write a ScalaTest class as follows:
class MyActorUnitTest extends FunSpec with MustMatchers with ScalaFutures with BeforeAndAfter with FunSpecLike{
test("Test my actor's behaviour")
}
Now, when I try to compile or run sbt test it complains that I would also like to leverage the Akka Test Kit. So i tried writing as below. But I cannot compile it again, because it complains that I can't use both Funspec and Funsuite at the same time. Besides And the test() method is only available if I extend from Funsuite or (mix in) the Funsuite Trait.
And, if I do something like below.
class MyUnitTest(_system: ActorSystem) extends TestKit(_system) //with FunSpecLike with FunSuiteLike with ScalaFutures with MustMatchers with BeforeAndAfter {
test("...")
}
It works. And it does not complain about "test()".
If I leave out FunsuuiteLike and bring in FunSpecLike, then I can't bring in "test()".
class MyActorUnitTest(_system: ActorSystem) extends TestKit(_system) with FunSpecLike //with FunSuiteLike with ScalaFutures with MustMatchers with BeforeAndAfter {
test("...") //this cause it to not compile or sbt test fails
}'
So, what do I do? I am not so familiar with the practice of mixing in traits, it seems.
I would like to use both FunspecLike and FunSuiteLike and I would like TestKit as shown above.