I am using ScalaMock 3.0 with ScalaTest and Scala 2.10. When I try to mock a class that inherits from java.io.File I get the following compliation error. method getPrefixLength overrides nothing
Here is some sample code:
class TrendSpec extends FunSpec with MockFactory {
class A extends java.io.File("")
val a = mock[A]
}
Is there anyway of working around this?
The problem is that
getPrefixLengthis package private, but the reflection API seems to be broken for package private variables. There’s an ongoing discussion on the scala-user mailing list about this.Please do report this as a bug on the ScalaMock bug tracker