summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-07-17 12:10:09 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-07-17 12:10:09 -0400
commit7e21e92aedf6daa432745f792ef70b676468023a (patch)
treeb30d187f86d04a058ad26036b1f4f06895377eac
parent2434f91cebaf173436117efb2316ee2299b9aebf (diff)
downloadsdl_ios-7e21e92aedf6daa432745f792ef70b676468023a.tar.gz
File manager test changes
-rw-r--r--SmartDeviceLink/SDLFileManager.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m12
2 files changed, 7 insertions, 7 deletions
diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m
index a5b205ff0..215c098d2 100644
--- a/SmartDeviceLink/SDLFileManager.m
+++ b/SmartDeviceLink/SDLFileManager.m
@@ -430,7 +430,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
if (completion == nil) { return; }
if ([weakself sdl_isErrorCannotOverwriteError:error]) {
// Artwork with same name already uploaded to remote
- return completion(true, artwork.name, bytesAvailable, nil);
+ return completion(YES, artwork.name, bytesAvailable, nil);
}
completion(success, artwork.name, bytesAvailable, error);
}];
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
index b3b076e30..5cb8377f4 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
@@ -414,9 +414,9 @@ describe(@"uploading / deleting single files with the file manager", ^{
SDLArtwork *art = [SDLArtwork artworkWithImage:testUIImage name:expectedArtworkName asImageFormat:SDLArtworkImageFormatPNG];
[testFileManager uploadArtwork:art completionHandler:^(BOOL success, NSString * _Nonnull artworkName, NSUInteger bytesAvailable, NSError * _Nullable error) {
- expect(success).to(beFalse());
+ expect(success).to(beTrue());
expect(bytesAvailable).to(equal(initialSpaceAvailable));
- expect(error).toNot(beNil());
+ expect(error).to(beNil());
}];
expect(testFileManager.pendingTransactions.count).to(equal(0));
@@ -940,7 +940,7 @@ describe(@"uploading/deleting multiple files in the file manager", ^{
expect(testFileManager.bytesAvailable).to(equal(newBytesAvailable));
});
- fit(@"should cancel the remaining files if cancel is triggered after half of the files are uploaded", ^{
+ it(@"should cancel the remaining files if cancel is triggered after half of the files are uploaded", ^{
for(int i = 0; i < 5; i += 1) {
NSString *testFileName = [NSString stringWithFormat:@"TestSmallFilesMemory%d", i];
SDLFile *testSDLFile = [SDLFile fileWithData:[@"someTextData" dataUsingEncoding:NSUTF8StringEncoding] name:testFileName fileExtension:@"bin"];
@@ -971,7 +971,7 @@ describe(@"uploading/deleting multiple files in the file manager", ^{
expect(testFileManager.pendingTransactions.count).to(equal(5));
for (int i = 0; i < 3; i++) {
- SDLUploadFileOperation *sentOperation = testFileManager.pendingTransactions.firstObject;
+ SDLUploadFileOperation *sentOperation = testFileManager.pendingTransactions[i];
sentOperation.fileWrapper.completionHandler(YES, newBytesAvailable, nil);
}
@@ -1004,7 +1004,7 @@ describe(@"uploading/deleting multiple files in the file manager", ^{
expect(testFileManager.pendingTransactions.count).to(equal(5));
for (int i = 0; i < 5; i++) {
- SDLUploadFileOperation *sentOperation = testFileManager.pendingTransactions.firstObject;
+ SDLUploadFileOperation *sentOperation = testFileManager.pendingTransactions[i];
sentOperation.fileWrapper.completionHandler(YES, newBytesAvailable, nil);
}
expect(testFileManager.bytesAvailable).to(equal(newBytesAvailable));
@@ -1155,7 +1155,7 @@ describe(@"uploading/deleting multiple files in the file manager", ^{
expect(testFileManager.remoteFileNames).to(haveCount(1));
});
- fit(@"should return an error if all files fail to delete", ^{
+ it(@"should return an error if all files fail to delete", ^{
[testFileManager deleteRemoteFilesWithNames:@[@"AA", @"BB", @"CC", @"DD", @"EE", @"FF"] completionHandler:^(NSError * _Nullable error) {
expect(error).toNot(beNil());
}];