This document uses a project named "Example" that has an existing target "ExampleApp". This is the target you will host you tests in.
$ mkdir Externals
$ git submodule add git://github.com/pivotal/cedar.git Externals/Cedar
$ cd Externals/Cedar/; ./installCodeSnippetsAndTemplates; cd -;
Including Cedar from a submodule for access to all the Cedar files, but using CocoaPods to pull it into the project. Set this up by:
- Add a new target of type "iOS Cedar Testing Bundle":
(File > New > Target… > Cedar > iOS Cedar Testing Bundle):
Product Name: ExampleSpecs
Organization Name: Mark Haylock
Company Identifier: com.resolvedigital
Bundle Identifier: com.resolvedigital.ExampleSpecs
Test Target: AStoryUnfolds
Bundle Loader: $(BUILT_PRODUCTS_DIR)/Example.app/Example
Other Settings: ✔ Use Automatic Reference Counting
Project: Example
-
Edit the scheme for "Example" and add "ExampleSpecs" to the "Test" tab.
-
Install CocoaPods using these commands:
$ gem install cocoapods
$ pod setup
- Add ./Podfile with custom exclusive "test" target to link with "ExampleSpecs":
platform :ios, '6.0'
target :test, :exclusive => true do
link_with 'ExampleSpecs'
pod 'Cedar', :local => 'Externals/Cedar', :podspec => 'https://raw.github.com/CocoaPods/Specs/master/Cedar/0.9.0/Cedar.podspec'
end
- Run:
$ pod install
-
Removed
OTHER_LDFLAGS
from the build settings for "ExampleSpecs" so that CocoaPods controls this instead. -
From now on opening generated ./Example.xcworkspace instead of ./Example.xcodeproj so that CocoaPods "Pods" project is included.
-
Add ./Pods folder to .gitignore as CocoaPods can regenerate the contents of the folder (and you don't overwhelm your git history with all those dependency files).