Skip to content

myihsan/iOSMockingbirdExample-SPM

Repository files navigation

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:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages