Open DenisNovac opened 1 year ago
Hi. Thanks for raising an issue for visibility.
In all frankness and at the risk of disappointing you, this is not something that I will dedicate time to investigate. If you find the root cause of the issue, and a potential fix, I'll happily look at a PR though :)
Hello, sure, it's ok, i was just wondering if anyone already had similar problem and fixed it somehow.
As a workaround i used MockitoCats
from mockito-scala instead of ScalaMock. This library doesn't depend on scala's test frameworks so it worked out for me.
The issue is that the MockFactory
you're using is probably scalatest-specific. Instead, you should extend org.scalamock.MockFactoryBase
(which is framework-agnostic) and implement the newExpectationException
function.
Not a great implementation but this should get you going:
type ExpectationException = Throwable
protected def newExpectationException(message: String, methodName: Option[Symbol]): ExpectationException =
new Throwable(s"$methodName: $message")
Weaver version: "0.8.1" Scalamock version: "5.2.0"
In build.sbt:
Example code:
Test "test" will never be called while suite is extended by
MockFactory
. If you removewith MockFactory
- it will work fine.