Closed andreisilviudragnea closed 2 years ago
@barkhorn Any help with this?
I suggest familiarizing yourself with this topic: https://scalamock.org/user-guide/matching/
I'll close this issue as this place is not for usage help. If you require a more detailed answer, you should try stackoverflow, or use the resources here https://scalamock.org/help/
If you want to discuss a new feature, please ignore/clear this form.
ScalaMock Version (e.g. 3.5.0)
3.5.0
Scala Version (e.g. 2.12)
2.13.6
Runtime (JVM or JS)
JVM
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.
The following test runs and passes:
https://github.com/andreisilviudragnea/scala-playground/blob/main/src/test/scala/org/example/ScalaMockSpec.scala
How can I mock the
logger.info
call to expect a specificString
as input (or any other matcher apart from*
)?I tried doing something like this:
The test compiles, but fails because the mock is not set up properly.