ScalaMock
ScalaMock copied to clipboard
Mocking classes with constructor params with applied types fails
ScalaMock Version (e.g. 3.5.0)
6.0.0
Scala Version (e.g. 2.12)
3.3.3
Runtime (JVM or JS)
JVM
Please describe the expected behavior of the issue
mocking classes with generic parameters works as expected
Please provide a description of what actually happens
compilation fails, with
Found: Option
Required: Option[Int]
Reproducible Test Case
Please provide a minimised code snippet that fails, ideally, written as a failing test case in ScalaTest. This will help us a lot in diagnosing the problem and work on a fix. If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.
import org.scalamock.scalatest.MockFactory
import org.scalatest.funsuite.AnyFunSuite
class Example(opt: Option[Int])
class ReallySimpleExampleTest extends AnyFunSuite with MockFactory {
test("example") {
mock[Example]
}
}
https://scastie.scala-lang.org/5NtYSNzkTImhshrePP6Mzg