From 85c9b2a4d2c9ea061b0310d44e916a00d2d4ee0a Mon Sep 17 00:00:00 2001 From: NicoleYarroch Date: Wed, 28 Apr 2021 07:37:58 -0400 Subject: Refactored list files test Signed-off-by: NicoleYarroch --- .../DevAPISpecs/SDLFileManagerSpec.m | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m index 83a2f8a4d..b663009a7 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m @@ -143,20 +143,7 @@ describe(@"uploading / deleting single files with the file manager", ^{ }); }); - describe(@"after receiving a ListFiles error due to the file manager not being able to start", ^{ - beforeEach(^{ - SDLListFilesOperation *operation = testFileManager.pendingTransactions.firstObject; - operation.completionHandler(NO, initialSpaceAvailable, testInitialFileNames, [NSError sdl_fileManager_unableToStartError]); - }); - - it(@"should handle the error properly", ^{ - expect(testFileManager.currentState).to(match(SDLFileManagerStateStartupError)); - expect(testFileManager.remoteFileNames).to(beEmpty()); - expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable)); - }); - }); - - describe(@"getting an error from the module to a ListFiles request", ^{ + describe(@"getting an error for a ListFiles request", ^{ __block SDLListFilesOperation *operation = nil; beforeEach(^{ @@ -186,6 +173,14 @@ describe(@"uploading / deleting single files with the file manager", ^{ expect(testFileManager.remoteFileNames).to(beEmpty()); expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable)); }); + + it(@"should transition to the error state if it gets a ListFiles error without a resultCode", ^{ + operation.completionHandler(NO, initialSpaceAvailable, testInitialFileNames, [NSError sdl_fileManager_unableToStartError]); + + expect(testFileManager.currentState).to(match(SDLFileManagerStateStartupError)); + expect(testFileManager.remoteFileNames).to(beEmpty()); + expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable)); + }); }); describe(@"after receiving a ListFiles response", ^{ -- cgit v1.2.1