Unit testing of static library that involves NSDocumentDirectory and other iOS App specific calls.
- by Shiun
Hi,
I'm attempting to run unit tests for a static library that attempts to create/write/read a file in the document directory. Since this is a static library and not an application for the iOS, attempts to reference the NSDocumentDirectory is returning me directory for the form
"/Users//Library/Application Support/iPhone Simulator/Documents"
This directory does not exist. When attempting to access a directory from an actual application, the NSDocumentDirectory returns something of the form:
"/Users//Library/Application Support/iPhone Simulator/4.2/FEDBEF5F-1326-4383-A087-CDA1B865E61A/Documents"
(Please note the simulator version as well as application ID as part of the path)
How can I overcome this shortcoming in the unit test framework for static libraries that implement tests that require iOS app specific calls?
Thanks in advance.