scala – 非法继承,如何设计我的层次结构来创建我的UnitSpec
发布时间:2020-12-16 18:33:36 所属栏目:安全 来源:网络整理
导读:我正在尝试为我的单元测试创??建一个BaseSpec类,如下所示: abstract class FunSpecBase extends FunSpec with BeforeAndAftertrait GuiceBase extends ScalaModule { def configure() { bind[userDao].to[UserDaoImpl] // more here }}abstract class UnitB
我正在尝试为我的单元测试创??建一个BaseSpec类,如下所示:
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 当我在sbt中运行我的测试时,我得到错误: 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 有可能解决这个场景吗? 解决方法
也许你想要:
trait GuiceBase extends ScalaModule { def configure() { // bind[userDao].to[UserDaoImpl] // more here } } abstract class UnitBase extends GuiceBase with FunSpecLike class UnitSpec extends UnitBase (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 如何取消订阅Angular2中的Firebase列表?
- VIM CFPasteboardRef CFPasteboardCreate(CFAllocatorRef,
- shell – 查找并删除主文件夹中的所有符号链接,无法使其正常
- vim – 电力线可以显示在多个缓冲区中,但不能显示在单个缓冲
- angularjs – 如何让angular.js重新评估/重新编译内部html?
- bash – 如何在autoconf / m4中转义文本?
- WSDL说明
- 分享六个基于Bootstrap的实用开发教程和模板演示
- 为什么这个bash结构有效? (参数取代)
- angularjs – angular.js $http.post不工作?? – 没有错误