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

Inherit protocol modifiers

Open bradleymackey opened this issue 7 months ago • 5 comments

  • Allows protocols with any modifiers, like public, fileprivate etc. to inherit this access on the spy and all the generated members. This is done by taking the modifiers on the original protocol definition and applying it to all generated members.
    • private protocol members will inherit an access level fileprivate instead. A protocol declared private at file-scope is effectively treated as fileprivate. This access level on the generated members is required to satisfy the protocol requirements
  • Generate an init with the same access level, allowing the spy to be created outside of the current module (as the default init level is internal).
  • Adds tests for all use cases.
  • Closes #73 , fixes #72

Thanks for the great library! This is the best spy/mock generator out there atm.

bradleymackey avatar Jan 19 '24 11:01 bradleymackey