swift-fakes
swift-fakes copied to clipboard
Test Doubles for Swift
Handrolling fakes is a pain. It would be awesome to be able to write: ```swift @AutoFake final class FakeThing: Thing {} ``` and have Swift just... generate the thing for...
In [Python's Mock](https://docs.python.org/3/library/unittest.mock.html), you can configure the `side_effect` property to return an array of values. If you do this, the mock will return those values one after another when called....
In [Python's Mock](https://docs.python.org/3/library/unittest.mock.html), you can configure the `side_effect` property to call a function when the mock is called. Spy should offer similar behavior.
If you try to apply a spy to a property, you're gonna have a bad time. Read-only properties are at least not terrible, because they behave like standard functions. ```swift...