Hey Hoang,
I tried to rebuild your awesome tutorial in Xcode 8.2.1 / Swift 3. I'm stuck with the XCTest extension:
public func stub(urlString: String, jsonFileName: String) -> Mockingjay.Stub {
let path = NSBundle(forClass: self.dynamicType).pathForResource(jsonFileName, ofType: "json")!
let data = NSData(contentsOfFile: path)!
return stub(uri(urlString), builder: jsonData(data))
}
public func stub(urlString: String, error: NSError) -> Mockingjay.Stub {
return stub(uri(urlString), builder: failure(error))
}
Any idea how to rewrite the data as Data since contentsOfFile is no longer an option?