Update test case `test06ThatUsingACustomDownloaderOperationWorks`

This commit is contained in:
DreamPiggy 2022-11-08 20:04:36 +08:00
parent 9aa27b61e8
commit f8d353b50c
1 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,11 @@
NSURL *imageURL2 = [NSURL URLWithString:kTestPNGURL];
NSURL *imageURL3 = [NSURL URLWithString:kTestGIFURL];
// we try to set a usual NSOperation as operation class. Should not work
downloader.config.operationClass = [NSOperation class];
@try {
downloader.config.operationClass = [NSOperation class];
} @catch (NSException *exception) {
expect(exception).notTo.beNil();
}
SDWebImageDownloadToken *token = [downloader downloadImageWithURL:imageURL1 options:0 progress:nil completed:nil];
NSOperation<SDWebImageDownloaderOperation> *operation = token.downloadOperation;
expect([operation class]).to.equal([SDWebImageDownloaderOperation class]);