Skip to content
This repository
Browse code

Added new files to mac project

  • Loading branch information...
commit 4d26738f1f43b75b9c1036b5a663f6d4225d68af 1 parent 148d67e
Ben Copsey authored June 21, 2009
8  Classes/Tests/ASIHTTPRequestTests.m
@@ -372,12 +372,16 @@ - (void)testCookies
372 372
 	
373 373
 	// Test setting a custom cookie works
374 374
 	NSDictionary *cookieProperties = [[[NSMutableDictionary alloc] init] autorelease];
375  
-	[cookieProperties setValue:@"Test Value" forKey:NSHTTPCookieValue];
  375
+	
  376
+	// We'll add a line break to our cookie value to test it gets correctly encoded
  377
+	[cookieProperties setValue:[@"Test\r\nValue" encodedCookieValue] forKey:NSHTTPCookieValue];
376 378
 	[cookieProperties setValue:@"ASIHTTPRequestTestCookie" forKey:NSHTTPCookieName];
377 379
 	[cookieProperties setValue:@"allseeing-i.com" forKey:NSHTTPCookieDomain];
378 380
 	[cookieProperties setValue:[NSDate dateWithTimeIntervalSinceNow:60*60*4] forKey:NSHTTPCookieExpires];
379 381
 	[cookieProperties setValue:@"/ASIHTTPRequest/tests" forKey:NSHTTPCookiePath];
380 382
 	cookie = [[[NSHTTPCookie alloc] initWithProperties:cookieProperties] autorelease];
  383
+	
  384
+	GHAssertNotNil(cookie,@"Failed to create a cookie - cookie value was not correctly encoded?");
381 385
 
382 386
 	url = [[[NSURL alloc] initWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/read_cookie"] autorelease];
383 387
 	request = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease];
@@ -385,7 +389,7 @@ - (void)testCookies
385 389
 	[request setRequestCookies:[NSMutableArray arrayWithObject:cookie]];
386 390
 	[request start];
387 391
 	html = [request responseString];
388  
-	success = [html isEqualToString:@"I have 'Test Value' as the value of 'ASIHTTPRequestTestCookie'"];
  392
+	success = [html isEqualToString:@"I have 'Test\r\nValue' as the value of 'ASIHTTPRequestTestCookie'"];
389 393
 	GHAssertTrue(success,@"Custom cookie not presented to the server with cookie persistance OFF");
390 394
 	
391 395
 
16  Mac.xcodeproj/project.pbxproj
@@ -11,7 +11,6 @@
11 11
 		B55B5D200F76568E0064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
12 12
 		B55B5D210F76568E0064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
13 13
 		B55B5D220F76568E0064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D160F76568E0064029C /* ASINetworkQueue.m */; };
14  
-		B55B5D230F76568E0064029C /* NSHTTPCookieAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D180F76568E0064029C /* NSHTTPCookieAdditions.m */; };
15 14
 		B55B5E700F7656A40064029C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5E6E0F7656A40064029C /* main.m */; };
16 15
 		B55B5E7F0F76573B0064029C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B55B5E730F7656DA0064029C /* MainMenu.xib */; };
17 16
 		B55B5EB80F7658200064029C /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B55B5EB70F7658200064029C /* libz.1.2.3.dylib */; };
@@ -20,10 +19,11 @@
20 19
 		B55B60090F76597C0064029C /* ASIHTTPRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D1D0F76568E0064029C /* ASIHTTPRequestTests.m */; };
21 20
 		B55B600A0F7659800064029C /* ASINetworkQueueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D1F0F76568E0064029C /* ASINetworkQueueTests.m */; };
22 21
 		B55B600C0F7659880064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D160F76568E0064029C /* ASINetworkQueue.m */; };
23  
-		B55B600E0F76598D0064029C /* NSHTTPCookieAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D180F76568E0064029C /* NSHTTPCookieAdditions.m */; };
24 22
 		B55B600F0F7659900064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D140F76568E0064029C /* ASIHTTPRequest.m */; };
25 23
 		B55B60100F7659960064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B5D120F76568E0064029C /* ASIFormDataRequest.m */; };
26 24
 		B55B60140F7659A30064029C /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B55B5EB70F7658200064029C /* libz.1.2.3.dylib */; };
  25
+		B564D0520FEE677F00A2098A /* ASINSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B564D0500FEE677F00A2098A /* ASINSStringAdditions.m */; };
  26
+		B564D0530FEE678C00A2098A /* ASINSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B564D0500FEE677F00A2098A /* ASINSStringAdditions.m */; };
27 27
 		B5B513680FBEE435002C74D0 /* GHUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5B513670FBEE435002C74D0 /* GHUnit.framework */; };
28 28
 		B5B513830FBEE490002C74D0 /* GHUnit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5B513670FBEE435002C74D0 /* GHUnit.framework */; };
29 29
 		B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */; };
@@ -54,8 +54,6 @@
54 54
 		B55B5D140F76568E0064029C /* ASIHTTPRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIHTTPRequest.m; sourceTree = "<group>"; };
55 55
 		B55B5D150F76568E0064029C /* ASINetworkQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASINetworkQueue.h; sourceTree = "<group>"; };
56 56
 		B55B5D160F76568E0064029C /* ASINetworkQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASINetworkQueue.m; sourceTree = "<group>"; };
57  
-		B55B5D170F76568E0064029C /* NSHTTPCookieAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSHTTPCookieAdditions.h; sourceTree = "<group>"; };
58  
-		B55B5D180F76568E0064029C /* NSHTTPCookieAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSHTTPCookieAdditions.m; sourceTree = "<group>"; };
59 57
 		B55B5D1A0F76568E0064029C /* ASIFormDataRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIFormDataRequestTests.h; sourceTree = "<group>"; };
60 58
 		B55B5D1B0F76568E0064029C /* ASIFormDataRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIFormDataRequestTests.m; sourceTree = "<group>"; };
61 59
 		B55B5D1C0F76568E0064029C /* ASIHTTPRequestTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequestTests.h; sourceTree = "<group>"; };
@@ -71,6 +69,8 @@
71 69
 		B55B5ED00F76588D0064029C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = "Mac Sample/AppDelegate.h"; sourceTree = "<group>"; };
72 70
 		B55B5ED10F76588D0064029C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = "Mac Sample/AppDelegate.m"; sourceTree = "<group>"; };
73 71
 		B55B5EDF0F7658C70064029C /* Unit Tests (GHUnit).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Unit Tests (GHUnit).app"; sourceTree = BUILT_PRODUCTS_DIR; };
  72
+		B564D0500FEE677F00A2098A /* ASINSStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASINSStringAdditions.m; sourceTree = "<group>"; };
  73
+		B564D0510FEE677F00A2098A /* ASINSStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASINSStringAdditions.h; sourceTree = "<group>"; };
74 74
 		B5B513670FBEE435002C74D0 /* GHUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GHUnit.framework; path = Frameworks/GHUnit.framework; sourceTree = "<group>"; };
75 75
 		B5B513850FBEE515002C74D0 /* GHUnitTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitTestMain.m; sourceTree = "<group>"; };
76 76
 		B5E3858B0F76606B00FD7857 /* Tests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Tests-Info.plist"; path = "Mac Sample/Tests-Info.plist"; sourceTree = "<group>"; };
@@ -179,8 +179,8 @@
179 179
 				B55B5D140F76568E0064029C /* ASIHTTPRequest.m */,
180 180
 				B55B5D150F76568E0064029C /* ASINetworkQueue.h */,
181 181
 				B55B5D160F76568E0064029C /* ASINetworkQueue.m */,
182  
-				B55B5D170F76568E0064029C /* NSHTTPCookieAdditions.h */,
183  
-				B55B5D180F76568E0064029C /* NSHTTPCookieAdditions.m */,
  182
+				B564D0510FEE677F00A2098A /* ASINSStringAdditions.h */,
  183
+				B564D0500FEE677F00A2098A /* ASINSStringAdditions.m */,
184 184
 				B55B5D190F76568E0064029C /* Tests */,
185 185
 			);
186 186
 			path = Classes;
@@ -283,9 +283,9 @@
283 283
 				B55B5D200F76568E0064029C /* ASIFormDataRequest.m in Sources */,
284 284
 				B55B5D210F76568E0064029C /* ASIHTTPRequest.m in Sources */,
285 285
 				B55B5D220F76568E0064029C /* ASINetworkQueue.m in Sources */,
286  
-				B55B5D230F76568E0064029C /* NSHTTPCookieAdditions.m in Sources */,
287 286
 				B55B5ED20F76588D0064029C /* AppDelegate.m in Sources */,
288 287
 				B55B5E700F7656A40064029C /* main.m in Sources */,
  288
+				B564D0530FEE678C00A2098A /* ASINSStringAdditions.m in Sources */,
289 289
 			);
290 290
 			runOnlyForDeploymentPostprocessing = 0;
291 291
 		};
@@ -297,10 +297,10 @@
297 297
 				B55B60090F76597C0064029C /* ASIHTTPRequestTests.m in Sources */,
298 298
 				B55B600A0F7659800064029C /* ASINetworkQueueTests.m in Sources */,
299 299
 				B55B600C0F7659880064029C /* ASINetworkQueue.m in Sources */,
300  
-				B55B600E0F76598D0064029C /* NSHTTPCookieAdditions.m in Sources */,
301 300
 				B55B600F0F7659900064029C /* ASIHTTPRequest.m in Sources */,
302 301
 				B55B60100F7659960064029C /* ASIFormDataRequest.m in Sources */,
303 302
 				B5B513860FBEE515002C74D0 /* GHUnitTestMain.m in Sources */,
  303
+				B564D0520FEE677F00A2098A /* ASINSStringAdditions.m in Sources */,
304 304
 			);
305 305
 			runOnlyForDeploymentPostprocessing = 0;
306 306
 		};

0 notes on commit 4d26738

Please sign in to comment.
Something went wrong with that request. Please try again.