I'm trying to create a BaseSpec class for my unit testing like so:
abstract class FunSpecBase extends FunSpec with BeforeAndAfter
trait GuiceBase extends ScalaModule {
def configure() {
bind[userDao].to[UserDaoImpl]
// more here
}
}
abstract class UnitBase extends FunSpecBase with GuiceBase
class UnitSpec extends UnitBase
When I run my test in sbt I get the error:
illegal inheritance; superclass FunSpecBase
[error] is not a subclass of the superclass ScalaModule
[error] of the mixin trait GuiceBase
[error] abstract class UnitBase extends FunSpecBase with GuiceBase
[error] ^
[error] one error found
Is it possible to work around this scenerio?
maybe you want:
trait GuiceBase extends ScalaModule {
def configure() {
// bind[userDao].to[UserDaoImpl]
// more here
}
}
abstract class UnitBase extends GuiceBase with FunSpecLike
class UnitSpec extends UnitBase
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With