1

I'm writing some tests with Specta/Expecta and have created a fresh Test target for my project. As part of one of the tests, I need to validate that certain files from a Folder Reference exist.

In my main target, I can do this and it locates the file as expected:

NSString* appJson = [[NSBundle mainBundle] pathForResource:@"ActionSheetTest" ofType:@"json"];

In my test target however, I cannot (appJson is nil). I've added the folder Tests to my "Copy Bundle Resources" in the Test target as seen below, but it still doesn't load. What am I doing wrong? I've also tried setting pathForResource to Tests/Controls/ActionSheetTest (which actually makes more sense to me) but that doesn't work either.

enter image description here

brandonscript
  • 68,675
  • 32
  • 163
  • 220
  • aha! [Why can't code inside unit tests find bundle resources?](http://stackoverflow.com/questions/1879247/why-cant-code-inside-unit-tests-find-bundle-resources) – brandonscript May 13 '15 at 20:07

0 Answers0