Skip to content

Commit

Permalink
including OCMock in the project and writing a simple unit test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
setuid committed Sep 29, 2012
1 parent a412780 commit 96dd348
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
# Xcode
build/*
builds/*
**/.DS_Store
AutoBuildCD/build/*
*.pbxuser
!default.pbxuser
Expand Down
16 changes: 16 additions & 0 deletions AutoBuildCD/AutoBuildCD.xcodeproj/project.pbxproj
Expand Up @@ -24,6 +24,7 @@
D95DE1B316177B81005E11EC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D95DE1B116177B81005E11EC /* InfoPlist.strings */; };
D95DE1B616177B81005E11EC /* AutoBuildCDTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D95DE1B516177B81005E11EC /* AutoBuildCDTests.m */; };
D95DE1C116178027005E11EC /* ABViewControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D95DE1C016178027005E11EC /* ABViewControllerTests.m */; };
D95DE1C316179746005E11EC /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D95DE1C216179746005E11EC /* libOCMock.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -61,6 +62,7 @@
D95DE1B516177B81005E11EC /* AutoBuildCDTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutoBuildCDTests.m; sourceTree = "<group>"; };
D95DE1BF16178027005E11EC /* ABViewControllerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABViewControllerTests.h; sourceTree = "<group>"; };
D95DE1C016178027005E11EC /* ABViewControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ABViewControllerTests.m; sourceTree = "<group>"; };
D95DE1C216179746005E11EC /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOCMock.a; path = ../libs/ocmock/Examples/iOS5Example/usr/lib/libOCMock.a; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -78,6 +80,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D95DE1C316179746005E11EC /* libOCMock.a in Frameworks */,
D95DE1A916177B81005E11EC /* SenTestingKit.framework in Frameworks */,
D95DE1AA16177B81005E11EC /* UIKit.framework in Frameworks */,
D95DE1AB16177B81005E11EC /* Foundation.framework in Frameworks */,
Expand All @@ -90,6 +93,7 @@
D95DE17516177B80005E11EC = {
isa = PBXGroup;
children = (
D95DE1C216179746005E11EC /* libOCMock.a */,
D95DE18A16177B80005E11EC /* AutoBuildCD */,
D95DE1AE16177B81005E11EC /* AutoBuildCDTests */,
D95DE18316177B80005E11EC /* Frameworks */,
Expand Down Expand Up @@ -410,7 +414,13 @@
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "AutoBuildCD/AutoBuildCD-Prefix.pch";
HEADER_SEARCH_PATHS = "$(SRCROOT)/../libs/ocmock/Examples/iOS5Example/usr/include/";
INFOPLIST_FILE = "AutoBuildCDTests/AutoBuildCDTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../libs/ocmock/Examples/iOS5Example/usr/lib\"",
);
OTHER_LDFLAGS = "-ObjC";
OTHER_TEST_FLAGS = "-RegisterForSystemEvents";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_AFTER_BUILD = YES;
Expand All @@ -429,7 +439,13 @@
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "AutoBuildCD/AutoBuildCD-Prefix.pch";
HEADER_SEARCH_PATHS = "$(SRCROOT)/../libs/ocmock/Examples/iOS5Example/usr/include/";
INFOPLIST_FILE = "AutoBuildCDTests/AutoBuildCDTests-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../libs/ocmock/Examples/iOS5Example/usr/lib\"",
);
OTHER_LDFLAGS = "-ObjC";
OTHER_TEST_FLAGS = "-RegisterForSystemEvents";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_AFTER_BUILD = YES;
Expand Down
7 changes: 7 additions & 0 deletions AutoBuildCD/AutoBuildCDTests/ABViewControllerTests.m
Expand Up @@ -8,6 +8,8 @@

#import "ABViewControllerTests.h"

#import <OCMock/OCMock.h>

@implementation ABViewControllerTests

-( void ) test_subviews_count
Expand All @@ -16,4 +18,9 @@ -( void ) test_subviews_count
STAssertTrue( [abvc.view.subviews count] == 0, @"" );
}

-( void ) test_ocmock
{
id mock = [OCMockObject mockForClass:[NSObject class]];
STAssertNotNil( mock, @"" );
}
@end

0 comments on commit 96dd348

Please sign in to comment.