aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMPathTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-07-26 17:00:52 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-07-26 17:00:52 +0000
commit5d588c34c079b3ac0333c2ef5eed6efb76b31b88 (patch)
tree294488e6da48402e4276603ef3853f39f67b9aaf /Foundation/GTMPathTest.m
parent4d56ee54c0f2b36d0e96db4a74e1b84d539df29d (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.m11
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 {