Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.75 KB

README.md

File metadata and controls

58 lines (39 loc) · 1.75 KB

Mockingbird Swift Package Manager Example

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.

Tutorial

1. Add Dependency

  1. File > Swift Packages > Add Package Dependency…
  2. Enter https://github.com/birdrides/mockingbird for the repository URL and click Next
  3. Choose “Up to Next Minor” for the version and click Next
  4. Select your test target under “Add to Target” and click Finish

2. Install Mockingbird

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)

3. Configure Test Target

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

4. Run Tests

Open the Xcode project.

$ open iOSMockingbirdExample-SPM.xcodeproj

Take a peek at the example test and sources and then run the tests (⌘+U):

Bonus: