我尝试了以下
import org.scalatest._
import org.scalamock._
import org.scalamock.scalatest._
class TestMock extends FlatSpec with MockFactory with ShouldMatchers {
"foo" should "bar" in {
val obj = mock[Object]
//...
}
}
并且编译器告诉我 self 的类型TestMock
不符合MockFactory
. 所以我把班级改成
class TestMock extends FlatSpec with MockFactory with ShouldMatchers {
self : MockFactory with Suite =>
"foo" should "bar" in {
val obj = mock[Object]
//...
}
}
现在它抱怨这mock
不是一个价值。
我正在使用 scalatest_2.10-2.0.M5b.jar 和 scalamock-scalatest-support_2.10-3.0.1.jar。
我究竟做错了什么?