Permalink
Browse files

Make tests more strict.

  • Loading branch information...
1 parent 4ae0d03 commit 7d063e0403b0b208d0b4839a5f2fde1e1b2e333a @pk committed Apr 22, 2012
@@ -67,8 +67,8 @@ - (PKWebSocketURL *)URL {
- (void)testCreateVaidOpeningHandshakeRequest {
PKHTTPRequest *request = [_handler handshakeRequestWithURL:[self URL] error:NULL];
STAssertNotNil(request, nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Upgrade"],nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Connection"],nil);
+ STAssertEqualObjects([request valueForHTTPHeaderField:@"Upgrade"], @"WebSocket", nil);
+ STAssertEqualObjects([request valueForHTTPHeaderField:@"Connection"], @"Upgrade", nil);
}
- (void)testAcceptsCorrectOpeningHandshakeResponse {
@@ -73,11 +73,11 @@ - (PKWebSocketURL *)URL {
- (void)testCreateVaidOpeningHandshakeRequest {
PKHTTPRequest *request = [_handler handshakeRequestWithURL:[self URL] error:NULL];
STAssertNotNil(request, nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Upgrade"],nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Connection"],nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Sec-WebSocket-Key1"],nil);
- STAssertNotNil([request valueForHTTPHeaderField:@"Sec-WebSocket-Key2"],nil);
- STAssertNotNil(request.body, nil);
+ STAssertEqualObjects([request valueForHTTPHeaderField:@"Upgrade"], @"WebSocket", nil);
+ STAssertEqualObjects([request valueForHTTPHeaderField:@"Connection"], @"Upgrade", nil);
+ STAssertNotNil([request valueForHTTPHeaderField:@"Sec-WebSocket-Key1"], @"There must be frst key.");
+ STAssertNotNil([request valueForHTTPHeaderField:@"Sec-WebSocket-Key2"], @"There must be second key.");
+ STAssertNotNil(request.body, @"There must be third key");
}
- (void)testAcceptsCorrectOpeningHandshakeResponse {

0 comments on commit 7d063e0

Please sign in to comment.