swift-spyable icon indicating copy to clipboard operation
swift-spyable copied to clipboard

Add the ability to specify the Access-level modifier of the Spy

Open tachyonics opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe. Given that it is currently not possible to generate a spy from a pre-existing protocol, it may be useful to centralize whatever work-around is used in a separate target or package. This will likely require an Access-level modifier other than internal.

Describe the solution you'd like At a minimum, the modifier of the spy should match the modifier of the protocol but to be more flexible having an explicit flag to indicate the modifier required could be useful.

tachyonics avatar Nov 16 '23 20:11 tachyonics

I believe we can introduce this feature as an option. I'm not fond of the idea of automatically generating access levels by default. In most use cases, folks can import the module in which the spy declaration resides by using the @testable attribute on the import statement.

Matejkob avatar Nov 21 '23 17:11 Matejkob