Skip to content

Use protocol's access control on the spy's declaration #72

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

Closed
AndreiVataselu opened this issue Dec 13, 2023 · 5 comments · Fixed by #130
Closed

Use protocol's access control on the spy's declaration #72

AndreiVataselu opened this issue Dec 13, 2023 · 5 comments · Fixed by #130

Comments

@AndreiVataselu
Copy link

Is your feature request related to a problem? Please describe.
If you use the macro on a public protocol declaration from module A and you have a unit test in another module that you'd like to use the protocol spy from module A, you don't have visibility to the Spy in module B since it's declared as internal.

Describe the solution you'd like
The generated spy should use the same access control as the attached protocol's.

Describe alternatives you've considered
You could import the module as testable

Additional context

@andriyslyusar
Copy link

@Matejkob Any chance to get this feature any time soon?

@armintelker
Copy link

@Matejkob This is an essential feature if you are using this in a library.

@Matejkob
Copy link
Owner

@armintelker I'm aware of that, and I already have a ready implementation on a branch, just waiting to test it. I'll try to create a PR in a few days!

@Matejkob Matejkob linked a pull request Nov 30, 2024 that will close this issue
@Matejkob
Copy link
Owner

Matejkob commented Nov 30, 2024

Hi everyone! Thanks for your patience and for emphasizing how important this feature is.

I’m happy to share that a new PR (#130) has been created to address this issue. The implementation ensures that generated spies inherit the protocol’s access control, solving the visibility issues described here.

I’m planning to merge the PR in 2/3 days to allow time for community feedback. I’d love to hear your thoughts or suggestions on the new implementation—your input is always valuable!

CC @AndreiVataselu @andriyslyusar @armintelker

@andriyslyusar
Copy link

Thanks you time and effort! I will give it a try next week.

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