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

scala 3 support #13

Open
senia-psm opened this issue Mar 16, 2022 · 1 comment · May be fixed by #14
Open

scala 3 support #13

senia-psm opened this issue Mar 16, 2022 · 1 comment · May be fixed by #14

Comments

@senia-psm
Copy link
Member

senia-psm commented Mar 16, 2022

Current implementation relies on scala 2 annotation macros.

There is no way to generate new methods/objects with scala 3 macros, so the current approach is not applicable to scala 3.

Additionally current approach relies on Assertion which is a subject for deprecation.

1 possible solution is to create something similar to ScalaMock:

val expect = (mock[Srv].method(_, _, _)).expect((a, b, c)=> assertTrue(a == 1, b == "", c < 0)).returns(valueF(_ => ???)).atMost(0)

val lessVerbose = mock[Srv](_.method _).assertParams(_ == 1, _ == "", _ < 0).returnF(_ => ???).atMost(0)
@senia-psm senia-psm linked a pull request Mar 17, 2022 that will close this issue
9 tasks
@goshacodes
Copy link

goshacodes commented Sep 28, 2024

Hi! I've created a stubbing library for scala 3 and probably it can replace zio-mock
https://github.com/goshacodes/backstub

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

Successfully merging a pull request may close this issue.

2 participants