I am trying to setup a testing environment for RestKit while using CocoaPods and I can’t seem to be able to include RestKit’s testing framework.
I followed Unit Testing with RestKit but I wasn’t able to include any of my podfiles.
Then I found this article about setting up CocoaPods with a small section about testing:
When trying to execute the unit tests of CookPix, I got this issue
LoggerClient.h not found As described above, pod install changes your
Xcode project main target (I guess it takes the one named like the
project) to base the target configuration on the Pods.xcconfig file.
This lets Xcode found the headers of your dependencies and compile
your project with the right flags as well.However it does not change the configuration of all targets and in our
case, the unit tests target. To fix that, click on your Xcode project,
then again on the Xcode project on the secondary panel, then on the
Info tab. Change the “Based on Configuration file” attribute of your
unit tests target to Pods. This should fix the dependencies of your
unit tests target.
This fixed the issue of including my pod files but I can’t get RestKit’s test framework installed. The compiler can’t find this file because the pod doesn’t install it.
#import <RestKit/Testing.h>
By looking at the CocoaPod spec it looks like it should be included. This is the relevant line in my Podfile.
pod 'RestKit', '0.10.1'
I also tried:
pod 'RestKit/Testing', '0.10.1'
With the same results.
I haven’t investigated why this works but to include RestKit’s testing files you must put
before
and clear out your pods directory and do a pod install. Or you might be able to skip this step if you are running Cocoapods 0.14.0.rc1 in which case you might be able to use pod update.