A minimal example of Mockingbird integrated into an Xcode project using Swift Package Manager’s Xcode integration.
Having issues setting up Mockingbird? Join the Slack channel or file an issue.
- File > Swift Packages > Add Package Dependency…
- Enter
https://github.com/birdrides/mockingbird
for the repository URL and click Next - Choose “Up to Next Minor” for the version and click Next
- Select your test target under “Add to Target” and click Finish
Initialize the package dependency and install the CLI.
$ xcodebuild -resolvePackageDependencies
$ DERIVED_DATA=$(xcodebuild -showBuildSettings | pcregrep -o1 'OBJROOT = (/.*)/Build')
$ (cd "${DERIVED_DATA}/SourcePackages/checkouts/mockingbird" && make install-prebuilt)
Download the starter supporting source files into your project root.
$ mockingbird download starter-pack
Then configure the test target.
$ mockingbird install \
--target iOSMockingbirdExample-SPMTests \
--source iOSMockingbirdExample-SPM
Open the Xcode project.
$ open iOSMockingbirdExample-SPM.xcodeproj
Take a peek at the example test and sources and then run the tests (⌘+U):
Bonus: