Skip to content

Commit 40f9812

Browse files
committed
Updates README
1 parent 37af720 commit 40f9812

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

MockGeneratorTests/IOSpy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ class IOSpy: IO {
1919
invokedCreateFileParametersList.append((path, data, attr))
2020
return stubbedCreateFileResult
2121
}
22-
}
22+
}

MockGeneratorTests/ResolverSpy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ class ResolverSpy: Resolver {
1919
invokedResolveParametersList.append((element, ()))
2020
return stubbedResolveResult
2121
}
22-
}
22+
}

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swift Mock Generator Xcode Source Editor Extension
22
![Mock Generator Icon](readme/AppIcon_256.png)
33

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.
4+
An Xcode extension (plugin) and command line tool 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.
55

66
![Xcode mock generator](readme/XcodeMockGenerator.gif)
77

@@ -18,6 +18,26 @@ An Xcode extension (plugin) to generate [spy](#what-is-a-spy), [stub](#what-is-a
1818
- Go to `System Preferences -> Security & Privacy -> Privacy -> Automation` and make sure `Swift Mock Generator` is enabled.
1919
- Open Xcode
2020

21+
## Sandboxing
22+
23+
This extension is fully sandboxed which means you need to give permission to read your project files before using it.
24+
25+
### Give permission when automatically detecting the project path
26+
27+
- Open the companion app.
28+
- Press "Give permission to read directory".
29+
- Select the directory and press "Grant permission".
30+
- In Xcode, generate your test double.
31+
32+
### Give permission when manually choosing the project path
33+
34+
- Open the companion app.
35+
- Press the select directory button.
36+
- Select the directory and press "Open".
37+
- In Xcode, generate your test double.
38+
39+
**Please note if using manual project paths before v0.25 you will have to select your project path again.**
40+
2141
## How to create a new Swift test double
2242

2343
- Create an empty class inheriting from a class or protocols that you wish to mock.
@@ -47,6 +67,18 @@ The mock generator will replace anything that is currently in your class with th
4767

4868
Undo is supported for Xcode plugins but you're safer to use a version control system such as `git` in the event of unexpectedly generating a test double.
4969

70+
## Using the command line tool
71+
72+
For convenience, create a symbolic link to the CLI.
73+
74+
```
75+
$ ln -s "/Applications/Swift Mock Generator for Xcode.app/Contents/MacOS/genmock" /usr/local/bin/genmock
76+
```
77+
78+
Use `$ genmock --help` for a list of options.
79+
80+
See how this project generates its mocks [here](https://github.com/seanhenry/SwiftMockGeneratorForXcode/blob/master/genmocks.sh).
81+
5082
## Features
5183

5284
| Feature | Supported |

0 commit comments

Comments
 (0)