2
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]
//...
}
}
和編譯器告訴我的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。
我在做什麼錯?