|
1 | 1 | # Swift Mock Generator Xcode Source Editor Extension |
2 | 2 |  |
3 | 3 |
|
4 | | -An Xcode extension (plugin) to generate spy, stub, and dummy classes automatically. |
| 4 | +An Xcode extension (plugin) to generate [spy](#what-is-a-spy-), [stub](#what-is-a-stub-), [dummy](#what-is-a-dummy-), and [partial spy](#what-is-a-partial-spy-) classes automatically. |
5 | 5 |
|
6 | 6 |  |
7 | 7 |
|
@@ -52,9 +52,10 @@ Undo is supported for Xcode plugins but you're safer to use a version control sy |
52 | 52 | | Feature | Supported | |
53 | 53 | |---|---| |
54 | 54 | | Swift 3 and 4.|✅| |
55 | | -| Generate and regenerate a spy.|✅| |
56 | | -| Generate and regenerate a stub.|✅| |
57 | | -| Generate and regenerate a dummy.|✅| |
| 55 | +| Generate a spy.|✅| |
| 56 | +| Generate a stub.|✅| |
| 57 | +| Generate a dummy.|✅| |
| 58 | +| Generate a partial spy.|✅| |
58 | 59 | | **Classes and protocols** | |
59 | 60 | | Generates test doubles conforming to one or many protocols.|✅| |
60 | 61 | | Generates test doubles conforming to a class.|✅\*| |
@@ -200,6 +201,22 @@ func test_spyCanCallClosure_withStubbedValue() { |
200 | 201 | } |
201 | 202 | ``` |
202 | 203 |
|
| 204 | +## What is a spy? |
| 205 | + |
| 206 | +Spies are stubs that also record some information based on how they were called. One form of this might be an email service that records how many messages it was sent. [See reference](https://martinfowler.com/bliki/TestDouble.html) |
| 207 | + |
| 208 | +## What is a stub? |
| 209 | + |
| 210 | +Stubs provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test. [See reference](https://martinfowler.com/bliki/TestDouble.html) |
| 211 | + |
| 212 | +## What is a dummy? |
| 213 | + |
| 214 | +Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists. [See reference](https://martinfowler.com/bliki/TestDouble.html) |
| 215 | + |
| 216 | +## What is a partial spy? |
| 217 | + |
| 218 | +Partial spies are spies which can also forward calls to the original implementation. |
| 219 | + |
203 | 220 | ## Disable or remove the plugin |
204 | 221 |
|
205 | 222 | To disable: |
|
0 commit comments