Issue testing and using Cocoapods in a Swift project

后端 未结 3 1009
陌清茗
陌清茗 2020-12-28 13:15

I\'m writing an app in Swift, using XCode 6 Beta-6. I\'m using Cocoapods and I\'m creating some unit tests.

The issue is this one: apparently is not possible to hav

3条回答
  •  无人及你
    2020-12-28 13:45

    If you take a look at your main target Build Settings, you will see that there are a bunch of directories listed for the "Header Search Paths" settings.

    You either need to copy those values under the test target, or you can try and modify your Podfile to include both your main and test targets and re-run install:

    platform :ios, '7.0' 
    link_with 'mainapp', 'mainappTests'
    ...
    

    Also take care of any other header paths that could be needed and are not related to CocoaPods.

    And don't forget that your classes shall have public methods wherever you want to unit-test them.

    Hope this helps.

提交回复
热议问题