Skip to content

Commit d0db9a2

Browse files
committed
Bugfix for CCPackageInstallerTests: Test removed bundle assets.
1 parent 64fc7e8 commit d0db9a2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

UnitTests/CCPackageInstallerTests.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,21 @@ - (void)testInstallFailingPackageAlreadyExists
122122

123123
- (void)setupInstallablePackage
124124
{
125+
_package.folderName = @"testpackage-iOS-phonehd";
126+
125127
NSString *pathToPackage = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Resources-shared/Packages/testpackage-iOS-phonehd_unzipped"];
128+
NSString *unzipPath = [NSTemporaryDirectory() stringByAppendingPathComponent:_package.folderName];
129+
130+
NSFileManager *fileManager = [NSFileManager defaultManager];
131+
NSError *error;
132+
[fileManager removeItemAtPath:unzipPath error:nil];
133+
if (![fileManager copyItemAtPath:pathToPackage toPath:unzipPath error:&error])
134+
{
135+
NSLog(@"%@", error);
136+
}
137+
138+
_package.unzipURL = [NSURL fileURLWithPath:unzipPath];
126139

127-
_package.unzipURL = [NSURL fileURLWithPath:pathToPackage];
128-
_package.folderName = @"testpackage-iOS-phonehd";
129140
_package.enableOnDownload = NO;
130141
}
131142

0 commit comments

Comments
 (0)