Testing that a particular image was copied to pasteboard
问题 I'm writing a test to verify a feature which copies an image to the pasteboard. Here's the test, as I would prefer to write it: // reset the paste board UIPasteboard.generalPasteboard.image = nil; //<-- this explodes XCTAssertNil(UIPasteboard.generalPasteboard.image); // Grab some random existing image UIImage *image = [UIImage imageNamed:@"some-image"]; MJKMyClass *myInstance = [[myInstance alloc] initWithImage:image]; [myInstance doSomethingThatCopiesImageToPasteboard] XCTAssertNotNil