Skip to content

Commit

Permalink
Convert to Xcode6 and XCTest, added podspec
Browse files Browse the repository at this point in the history
Support for iOS6 and earlier and non-ARC is being dropped
  • Loading branch information
carlbrown committed Sep 22, 2014
1 parent 83f19d2 commit 5f8c0c0
Show file tree
Hide file tree
Showing 13 changed files with 538 additions and 551 deletions.
Binary file added Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions SyntheticServerTest.podspec
@@ -0,0 +1,32 @@
Pod::Spec.new do |s|
s.name = 'SyntheticServerTest'
s.version = '0.8.0'
s.summary = 'An in-process webserver used to create "hard mocks" so that I can test from my code all the way through the network stack'
s.author = {
'Carl Brown' => 'carlb@pdagent.com'
}
s.homepage = "http://escortmissions.com/blog/2011/10/30/http-testing-to-the-edge-on-ios-the-school-of-hard-mocks.html"
s.license = { :type => 'Apache', :text => <<-LICENSE
New files and changes Copyright (C) 2011-2014 by Carl Brown of PDAgent, LLC.
Original Code Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
LICENSE
}
s.source = {
:git => 'https://github.com/carlbrown/SyntheticServerTest.git',
:tag => '0.8.0'
}
s.source_files = 'TestSupport/*.{h,m}'
s.requires_arc = true
end
62 changes: 45 additions & 17 deletions SyntheticServerTest.xcodeproj/project.pbxproj
Expand Up @@ -15,7 +15,6 @@
D319BB7D145CE32900D2CDB3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D319BB7C145CE32900D2CDB3 /* AppDelegate.m */; };
D319BB80145CE32900D2CDB3 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D319BB7F145CE32900D2CDB3 /* MainViewController.m */; };
D319BB86145CE32900D2CDB3 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D319BB84145CE32900D2CDB3 /* MainViewController.xib */; };
D319BB91145CE32900D2CDB3 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D319BB90145CE32900D2CDB3 /* SenTestingKit.framework */; };
D319BB92145CE32900D2CDB3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D319BB6C145CE32800D2CDB3 /* UIKit.framework */; };
D319BB93145CE32900D2CDB3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D319BB6E145CE32800D2CDB3 /* Foundation.framework */; };
D319BB9B145CE32900D2CDB3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D319BB99145CE32900D2CDB3 /* InfoPlist.strings */; };
Expand All @@ -29,6 +28,7 @@
D319BBD5145D0CAD00D2CDB3 /* GTMRegex.m in Sources */ = {isa = PBXBuildFile; fileRef = D319BBCE145D0CAD00D2CDB3 /* GTMRegex.m */; };
D319BBD6145D0CAD00D2CDB3 /* GTMTestHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = D319BBD0145D0CAD00D2CDB3 /* GTMTestHTTPServer.m */; };
D319BBD7145D0CAD00D2CDB3 /* PDBackgroundHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = D319BBD3145D0CAD00D2CDB3 /* PDBackgroundHTTPServer.m */; };
D3D9ACC819CCC7DE001F01AD /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D3D9ACC719CCC7DE001F01AD /* Default-568h@2x.png */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -55,8 +55,7 @@
D319BB7E145CE32900D2CDB3 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
D319BB7F145CE32900D2CDB3 /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
D319BB85145CE32900D2CDB3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainViewController.xib; sourceTree = "<group>"; };
D319BB8F145CE32900D2CDB3 /* SyntheticServerTestTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SyntheticServerTestTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
D319BB90145CE32900D2CDB3 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
D319BB8F145CE32900D2CDB3 /* SyntheticServerTestTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = SyntheticServerTestTests.octest; path = SyntheticServerTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D319BB98145CE32900D2CDB3 /* SyntheticServerTestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SyntheticServerTestTests-Info.plist"; sourceTree = "<group>"; };
D319BB9A145CE32900D2CDB3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
D319BB9D145CE32900D2CDB3 /* SyntheticServerTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SyntheticServerTestTests.m; sourceTree = "<group>"; };
Expand All @@ -66,7 +65,6 @@
D319BBC4145CF9C600D2CDB3 /* RegexOnNSString.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = RegexOnNSString.json; path = TestData/RegexOnNSString.json; sourceTree = SOURCE_ROOT; };
D319BBC8145D0CAC00D2CDB3 /* GTMDebugSelectorValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDebugSelectorValidation.h; path = TestSupport/GTMDebugSelectorValidation.h; sourceTree = "<group>"; };
D319BBC9145D0CAD00D2CDB3 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = TestSupport/GTMDefines.h; sourceTree = "<group>"; };
D319BBCA145D0CAD00D2CDB3 /* GTMGarbageCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMGarbageCollection.h; path = TestSupport/GTMGarbageCollection.h; sourceTree = "<group>"; };
D319BBCB145D0CAD00D2CDB3 /* GTMHTTPServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMHTTPServer.h; path = TestSupport/GTMHTTPServer.h; sourceTree = "<group>"; };
D319BBCC145D0CAD00D2CDB3 /* GTMHTTPServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMHTTPServer.m; path = TestSupport/GTMHTTPServer.m; sourceTree = "<group>"; };
D319BBCD145D0CAD00D2CDB3 /* GTMRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMRegex.h; path = TestSupport/GTMRegex.h; sourceTree = "<group>"; };
Expand All @@ -76,6 +74,7 @@
D319BBD1145D0CAD00D2CDB3 /* GTMTypeCasting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMTypeCasting.h; path = TestSupport/GTMTypeCasting.h; sourceTree = "<group>"; };
D319BBD2145D0CAD00D2CDB3 /* PDBackgroundHTTPServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDBackgroundHTTPServer.h; path = TestSupport/PDBackgroundHTTPServer.h; sourceTree = "<group>"; };
D319BBD3145D0CAD00D2CDB3 /* PDBackgroundHTTPServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PDBackgroundHTTPServer.m; path = TestSupport/PDBackgroundHTTPServer.m; sourceTree = "<group>"; };
D3D9ACC719CCC7DE001F01AD /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -94,7 +93,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D319BB91145CE32900D2CDB3 /* SenTestingKit.framework in Frameworks */,
D319BB92145CE32900D2CDB3 /* UIKit.framework in Frameworks */,
D319BB93145CE32900D2CDB3 /* Foundation.framework in Frameworks */,
D319BBB7145CE88800D2CDB3 /* CFNetwork.framework in Frameworks */,
Expand All @@ -107,6 +105,7 @@
D319BB5D145CE32800D2CDB3 = {
isa = PBXGroup;
children = (
D3D9ACC719CCC7DE001F01AD /* Default-568h@2x.png */,
D319BBD8145D0CB200D2CDB3 /* TestSupport */,
D319BB72145CE32900D2CDB3 /* SyntheticServerTest */,
D319BB96145CE32900D2CDB3 /* SyntheticServerTestTests */,
Expand All @@ -131,7 +130,6 @@
D319BB6C145CE32800D2CDB3 /* UIKit.framework */,
D319BB6E145CE32800D2CDB3 /* Foundation.framework */,
D319BB70145CE32900D2CDB3 /* CoreGraphics.framework */,
D319BB90145CE32900D2CDB3 /* SenTestingKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -194,7 +192,6 @@
children = (
D319BBC8145D0CAC00D2CDB3 /* GTMDebugSelectorValidation.h */,
D319BBC9145D0CAD00D2CDB3 /* GTMDefines.h */,
D319BBCA145D0CAD00D2CDB3 /* GTMGarbageCollection.h */,
D319BBCB145D0CAD00D2CDB3 /* GTMHTTPServer.h */,
D319BBCC145D0CAD00D2CDB3 /* GTMHTTPServer.m */,
D319BBCD145D0CAD00D2CDB3 /* GTMRegex.h */,
Expand Down Expand Up @@ -245,15 +242,16 @@
name = SyntheticServerTestTests;
productName = SyntheticServerTestTests;
productReference = D319BB8F145CE32900D2CDB3 /* SyntheticServerTestTests.octest */;
productType = "com.apple.product-type.bundle";
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
D319BB5F145CE32800D2CDB3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastTestingUpgradeCheck = 0600;
LastUpgradeCheck = 0600;
ORGANIZATIONNAME = "PDAgent, LLC";
};
buildConfigurationList = D319BB62145CE32800D2CDB3 /* Build configuration list for PBXProject "SyntheticServerTest" */;
Expand Down Expand Up @@ -281,6 +279,7 @@
files = (
D319BB77145CE32900D2CDB3 /* InfoPlist.strings in Resources */,
D319BB86145CE32900D2CDB3 /* MainViewController.xib in Resources */,
D3D9ACC819CCC7DE001F01AD /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -378,9 +377,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -390,10 +396,15 @@
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -402,15 +413,26 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -420,9 +442,11 @@
D319BBA2145CE32900D2CDB3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SyntheticServerTest/SyntheticServerTest-Prefix.pch";
INFOPLIST_FILE = "SyntheticServerTest/SyntheticServerTest-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -431,9 +455,11 @@
D319BBA3145CE32900D2CDB3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SyntheticServerTest/SyntheticServerTest-Prefix.pch";
INFOPLIST_FILE = "SyntheticServerTest/SyntheticServerTest-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -443,33 +469,33 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SyntheticServerTest.app/SyntheticServerTest";
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
"$(inherited)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SyntheticServerTest/SyntheticServerTest-Prefix.pch";
INFOPLIST_FILE = "SyntheticServerTestTests/SyntheticServerTestTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
D319BBA6145CE32900D2CDB3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SyntheticServerTest.app/SyntheticServerTest";
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
"$(inherited)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SyntheticServerTest/SyntheticServerTest-Prefix.pch";
INFOPLIST_FILE = "SyntheticServerTestTests/SyntheticServerTestTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = octest;
};
name = Release;
};
Expand All @@ -492,6 +518,7 @@
D319BBA3145CE32900D2CDB3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D319BBA4145CE32900D2CDB3 /* Build configuration list for PBXNativeTarget "SyntheticServerTestTests" */ = {
isa = XCConfigurationList;
Expand All @@ -500,6 +527,7 @@
D319BBA6145CE32900D2CDB3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
10 changes: 2 additions & 8 deletions SyntheticServerTest/AppDelegate.m
Expand Up @@ -15,18 +15,12 @@ @implementation AppDelegate
@synthesize window = _window;
@synthesize mainViewController = _mainViewController;

- (void)dealloc
{
[_window release];
[_mainViewController release];
[super dealloc];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.mainViewController = [[[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil] autorelease];
self.mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
self.window.rootViewController = self.mainViewController;
[self.window makeKeyAndVisible];
return YES;
Expand Down
42 changes: 36 additions & 6 deletions SyntheticServerTestTests/SyntheticServerTestTests.m
Expand Up @@ -7,10 +7,10 @@
// Copyright (c) 2011 PDAgent, LLC. Released under MIT License.
//

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>
#import "PDBackgroundHTTPServer.h"

@interface SyntheticServerTestTests : SenTestCase {
@interface SyntheticServerTestTests : XCTestCase {
PDBackgroundHTTPServer *testServer;
}

Expand All @@ -28,7 +28,7 @@ - (void)setUp
- (void)tearDown
{
[testServer setShouldStop:YES];
[testServer release]; testServer=nil;
testServer=nil;

[super tearDown];
}
Expand All @@ -38,15 +38,45 @@ - (void)testExample
NSString *testDataDirectory=[[[NSBundle bundleForClass:[self class]] pathForResource:@"carlbrown"
ofType:@"json"] stringByDeletingLastPathComponent];
[testServer startServerWithDocumentRoot:testDataDirectory];
STAssertTrue(([testServer port] > 0), @"should have a port assigned");
XCTAssertTrue(([testServer port] > 0), @"should have a port assigned");
NSString *urlString=[NSString stringWithFormat:@"http://localhost:%u/%@",[testServer port],@"carlbrown.json"];
NSURL *testURL=[NSURL URLWithString:urlString];
NSError *error=nil;
NSStringEncoding encoding;
NSString *test_json_String=[NSString stringWithContentsOfURL:testURL usedEncoding:&encoding error:&error];
STAssertNil(error, @"should not have gotten an error");
STAssertNotNil(test_json_String, @"Should have gotten data back");
XCTAssertNil(error, @"should not have gotten an error");
XCTAssertNotNil(test_json_String, @"Should have gotten data back");
}

- (void)testAsyncExample
{
NSString *testDataDirectory=[[[NSBundle bundleForClass:[self class]] pathForResource:@"carlbrown"
ofType:@"json"] stringByDeletingLastPathComponent];
[testServer startServerWithDocumentRoot:testDataDirectory];
XCTAssertTrue(([testServer port] > 0), @"should have a port assigned");
NSString *urlString=[NSString stringWithFormat:@"http://localhost:%u/%@",[testServer port],@"carlbrown.json"];
NSURL *testURL=[NSURL URLWithString:urlString];
XCTestExpectation *expectation = [self expectationWithDescription:@"Fetcher Expectation"];

NSURLSession *session = [NSURLSession sessionWithConfiguration:nil];
NSURLSessionDownloadTask *fetcher = [session downloadTaskWithURL:testURL completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) {
XCTAssertNil(error, @"should not have gotten an error");
XCTAssertNotNil(location, @"Should have gotten location of the data back");
[expectation fulfill];

}];
[fetcher resume];

[self waitForExpectationsWithTimeout:5.0 handler:^(NSError *error) {

if(error)
{
XCTFail(@"Expectation Failed with error: %@", error);
}

}];

}


@end
4 changes: 2 additions & 2 deletions TestSupport/GTMDebugSelectorValidation.h
Expand Up @@ -58,7 +58,7 @@ static void GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(id obj,
const char *foundArgType = [sig getArgumentTypeAtIndex:argCount];

_GTMDevAssert(0 == strncmp(foundArgType, expectedArgType, strlen(expectedArgType)),
@"\"%@\" selector \"%@\" argument %d should be type %s",
@"\"%@\" selector \"%@\" argument %lu should be type %s",
NSStringFromClass([obj class]),
NSStringFromSelector(sel),
(argCount - 2),
Expand All @@ -69,7 +69,7 @@ static void GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(id obj,

// check that the proper number of arguments are present in the selector
_GTMDevAssert(argCount == [sig numberOfArguments],
@"\"%@\" selector \"%@\" should have %d arguments",
@"\"%@\" selector \"%@\" should have %lu arguments",
NSStringFromClass([obj class]),
NSStringFromSelector(sel),
(argCount - 2));
Expand Down

0 comments on commit 5f8c0c0

Please sign in to comment.