I am trying to write some iOS logic tests against classes in my project that use functionality from some of the libraries in my podspec. I am using the standard unit test bu
As of CocoaPods 1.x, there's a new way to declare shared dependencies between a target and the corresponding test target. I'd been using the accepted solution by Mark Struzinski to this point, but using this method yielded a massive number of warnings when running my tests that:
Class SomeClass is implemented in both /Path/To/Test/Target and /Path/To/App/Target. One of the two will be used. Which one is undefined.
With CocoaPods 1.x we can declare our -Test target as inheriting via the parent target's search paths, like so:
target 'MyApp' do
pod 'aPod'
pod 'anotherPod'
project 'MyApp.xcodeproj'
end
target 'MyAppTests' do
inherit! :search_paths
project 'MyApp.xcodeproj'
end
This will result in the -Test target having access to the dependencies of the app target, without multiple binary copies. This has seriously sped up test build times for me.