Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specs2-mock does not support Scala 3 #1156

Closed
george-wilson-rea opened this issue May 31, 2023 · 3 comments
Closed

specs2-mock does not support Scala 3 #1156

george-wilson-rea opened this issue May 31, 2023 · 3 comments

Comments

@george-wilson-rea
Copy link

Can you please add a Scala 3 release of specs2-mock 4.20.0?

@etorreborre
Copy link
Owner

etorreborre commented May 31, 2023

Unfortunately I have dropped the support for specs2-mock for Scala 3 because this was a terrible hack. I described the move here with other assorted changes (follow-up blog post).

@tmccombs
Copy link
Contributor

So, what is the recommended replacement for scala 3? The first blog post mentions mockito-scala, but that doesn't support scala 3, and probably won't in the foreseeable future.

@etorreborre
Copy link
Owner

I was hoping that other libraries, like ScalaMock, would adapt faster to Scala3. Yet, as you've noticed, work is still ongoing. I think that, if we want to use mocks in Scala, we really need to embrace the language and have a specific library for it.

I must also say that, in my own practice, I don't use mocks anymore. I tend to implement traits with my own stubs and in general:

  • either use those as a model of the behaviour I'm expecting when testing something else
  • use them to collect data when my app is having side-effects (for logging, sending messages to other systems etc...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants