You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Changed
@Understudy is now @GenerateSpies, which says what it does: it writes a spy for every @Spied function and @SpiedProperty property. @Spied and @SpiedProperty keep their names. Replace @Understudy with @GenerateSpies; nothing else changes.
The README is a short guide: requirements, install, a quick start, one small example per feature, and what the macros refuse and why. Every example is checked against the current API.
Added
reset() on Spy, ThrowingSpy and PropertySpy, which forgets the calls (or gets and sets), where nextCall(within:) was, and the expectations, and keeps the scripted answers.
Actor doubles: @GenerateSpies on an actor writes the same members as on a class, with nonisolated spies a test reads without await. On a protocol that inherits Actor, it writes an actor spy.
Generic functions: @Spied writes a generic function whose generic parameters are whole parameter types or the whole return type (T or T?). The spy records each as any of its constraints, or Any, and the answer is cast back to the type the caller asks for.