Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add cocoapods to tests target too? [duplicate]

Tags:

ios

cocoapods

I have default project template with tests and cocoapods installed (pod install). Pods works fine with main target, but when I try to import something in tests, I get something like

Time.m:11:9: 'NSDate-Utilities.h' file not found

Does this mean that I should add pods directory to header search path in tests target? Can this be done via cocoapods CLI automatically somehow?


That question by suggested link had WRONG answer until yesterday.

like image 216
Nik Avatar asked Jul 25 '13 06:07

Nik


2 Answers

Ok, there is a simple solution, see answer above to get this working automatically. I had to select Pods/Pods configuration file for tests target in project info.

configuration file settings

like image 97
Nik Avatar answered Nov 11 '22 01:11

Nik


What you want to use is link_with from your Podfile. Something like:

link_with 'MainTarget', 'MainTargetTests'

Then run pod install again.

like image 21
Keith Smiley Avatar answered Nov 11 '22 03:11

Keith Smiley