NSURL to file path in test bundle with XCTest
I am trying to write an iOS app using TDD and the new XCTest framework. One of my methods retrieves a file from the internet (given a NSURL object) and stores it in the user's documents. The signature of the method is similar to: - (void) fetchAndStoreImage:(NSURL *)imageUrl I'm trying to write the test for this method in a way that it doesn't fail if there is no connection to the internet. My approach (taken from a previous question ) is to call the method using a NSURL to an image in the local file system. When a new project with unit tests enabled is created, the Tests directory has a