diff options
author | 2010-07-26 17:00:52 +0000 | |
---|---|---|
committer | 2010-07-26 17:00:52 +0000 | |
commit | 5d588c34c079b3ac0333c2ef5eed6efb76b31b88 (patch) | |
tree | 294488e6da48402e4276603ef3853f39f67b9aaf /Foundation/GTMPathTest.m | |
parent | 4d56ee54c0f2b36d0e96db4a74e1b84d539df29d (diff) |
[Author: dmaclach]
Added GTMNSFileHandle+UniqueName for easily and safely creating temporary files and
unique directory names.
Modified some tests to use the new calls.
R=thomasvl
DELTA=420 (397 added, 16 deleted, 7 changed)
Diffstat (limited to 'Foundation/GTMPathTest.m')
-rw-r--r-- | Foundation/GTMPathTest.m | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Foundation/GTMPathTest.m b/Foundation/GTMPathTest.m index 1e58f50..59e3199 100644 --- a/Foundation/GTMPathTest.m +++ b/Foundation/GTMPathTest.m @@ -19,6 +19,7 @@ #import "GTMSenTestCase.h" #import "GTMPath.h" #import "GTMUnitTestDevLog.h" +#import "GTMNSFileHandle+UniqueName.h" #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 // NSFileManager has improved substantially in Leopard and beyond, so GTMPath @@ -33,15 +34,11 @@ @implementation GTMPathTest - (void)setUp { - NSString *tmp = NSTemporaryDirectory(); - STAssertNotNil(tmp, nil); + NSFileManager *mgr = [NSFileManager defaultManager]; + testDirectory_ + = [[mgr gtm_createTemporaryDirectoryBasedOn:@"GTMPathTestXXXXXX"] retain]; - testDirectory_ = [[tmp stringByAppendingPathComponent:@"GTMPathTest"] retain]; STAssertNotNil(testDirectory_, nil); - - NSFileManager *mgr = [NSFileManager defaultManager]; - BOOL created = [mgr createDirectoryAtPath:testDirectory_ attributes:nil]; - STAssertTrue(created, nil); } - (void)tearDown { |