Vary the bundle identifier based on platform

The two different test targets will bundle up the required fixtures
under different bundle identifiers, this corrects the identifier based
on platform.
This commit is contained in:
Tom Booth 2016-02-16 00:49:59 +00:00
parent 7da9b0a084
commit ae91f54aa7

View File

@ -33,8 +33,14 @@ final class Fixtures {
func setUp() {
try! NSFileManager.defaultManager().createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil)
let bundle = NSBundle(identifier: "org.libgit2.SwiftGit2-OSXTests")!
#if os(OSX)
let platform = "OSX"
#else
let platform = "iOS"
#endif
let bundleIdentifier = String(format: "org.libgit2.SwiftGit2-%@Tests", arguments: [platform])
let bundle = NSBundle(identifier: bundleIdentifier)!
let zipURLs = bundle.URLsForResourcesWithExtension("zip", subdirectory: nil)! as [NSURL]
for URL in zipURLs {