- Update
This commit is contained in:
1 parent
d281d765ea
commit
5b074a5176
1261 files changed
+199158
-7303
No files matched your search
+270
@@ -0,0 +1,270 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0817B62B147ED03A00C5401D /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0817B62A147ED03A00C5401D /* SenTestingKit.framework */; };
|
||||
089BA20D1298F19A00D4F34F /* IsGivenDayOfWeek.m in Sources */ = {isa = PBXBuildFile; fileRef = 089BA20C1298F19A00D4F34F /* IsGivenDayOfWeek.m */; };
|
||||
08B5196E12A0678400147210 /* OCHamcrest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08B5196D12A0678400147210 /* OCHamcrest.framework */; };
|
||||
08B51A4D12A0688B00147210 /* OCHamcrest.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 08B5196D12A0678400147210 /* OCHamcrest.framework */; };
|
||||
0FC264990DA88F1100B4CD6B /* SampleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FC264980DA88F1100B4CD6B /* SampleTest.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
08B5189B12A0642100147210 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
08B51A4D12A0688B00147210 /* OCHamcrest.framework in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0817B62A147ED03A00C5401D /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
089BA20B1298F19A00D4F34F /* IsGivenDayOfWeek.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsGivenDayOfWeek.h; sourceTree = "<group>"; usesTabs = 0; };
|
||||
089BA20C1298F19A00D4F34F /* IsGivenDayOfWeek.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IsGivenDayOfWeek.m; sourceTree = "<group>"; usesTabs = 0; };
|
||||
08B5196D12A0678400147210 /* OCHamcrest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCHamcrest.framework; path = ../../OCHamcrest.framework; sourceTree = SOURCE_ROOT; };
|
||||
0FC2648E0DA88ECB00B4CD6B /* Example.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Example.octest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0FC264900DA88ECB00B4CD6B /* Example-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Example-Info.plist"; sourceTree = "<group>"; };
|
||||
0FC264980DA88F1100B4CD6B /* SampleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleTest.m; sourceTree = "<group>"; usesTabs = 0; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
0FC2648B0DA88ECB00B4CD6B /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
08B5196E12A0678400147210 /* OCHamcrest.framework in Frameworks */,
|
||||
0817B62B147ED03A00C5401D /* SenTestingKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0FC264760DA88EAA00B4CD6B = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
089BA20B1298F19A00D4F34F /* IsGivenDayOfWeek.h */,
|
||||
089BA20C1298F19A00D4F34F /* IsGivenDayOfWeek.m */,
|
||||
0FC264980DA88F1100B4CD6B /* SampleTest.m */,
|
||||
0FC2658B0DA8981900B4CD6B /* Resources */,
|
||||
0FC2658F0DA8983200B4CD6B /* Frameworks */,
|
||||
0FC2648F0DA88ECB00B4CD6B /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0FC2648F0DA88ECB00B4CD6B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0FC2648E0DA88ECB00B4CD6B /* Example.octest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0FC2658B0DA8981900B4CD6B /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0FC264900DA88ECB00B4CD6B /* Example-Info.plist */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0FC2658F0DA8983200B4CD6B /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0817B62A147ED03A00C5401D /* SenTestingKit.framework */,
|
||||
08B5196D12A0678400147210 /* OCHamcrest.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
0FC2648D0DA88ECB00B4CD6B /* Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 0FC264940DA88ECB00B4CD6B /* Build configuration list for PBXNativeTarget "Example" */;
|
||||
buildPhases = (
|
||||
0FC2648A0DA88ECB00B4CD6B /* Sources */,
|
||||
0FC2648B0DA88ECB00B4CD6B /* Frameworks */,
|
||||
08B5189B12A0642100147210 /* CopyFiles */,
|
||||
0FC2648C0DA88ECB00B4CD6B /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Example;
|
||||
productName = Example;
|
||||
productReference = 0FC2648E0DA88ECB00B4CD6B /* Example.octest */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0FC264780DA88EAA00B4CD6B /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0450;
|
||||
};
|
||||
buildConfigurationList = 0FC2647B0DA88EAA00B4CD6B /* Build configuration list for PBXProject "CustomDateMatcher" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 0FC264760DA88EAA00B4CD6B;
|
||||
productRefGroup = 0FC2648F0DA88ECB00B4CD6B /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
0FC2648D0DA88ECB00B4CD6B /* Example */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
0FC2648C0DA88ECB00B4CD6B /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
0FC2648A0DA88ECB00B4CD6B /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0FC264990DA88F1100B4CD6B /* SampleTest.m in Sources */,
|
||||
089BA20D1298F19A00D4F34F /* IsGivenDayOfWeek.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
0FC264790DA88EAA00B4CD6B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
0FC2647A0DA88EAA00B4CD6B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
0FC264920DA88ECB00B4CD6B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../..\"";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
INFOPLIST_FILE = "Example-Info.plist";
|
||||
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
Foundation,
|
||||
"-framework",
|
||||
SenTestingKit,
|
||||
);
|
||||
PRODUCT_NAME = Example;
|
||||
WRAPPER_EXTENSION = octest;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
0FC264930DA88ECB00B4CD6B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../..\"";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
INFOPLIST_FILE = "Example-Info.plist";
|
||||
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
Foundation,
|
||||
"-framework",
|
||||
SenTestingKit,
|
||||
);
|
||||
PRODUCT_NAME = Example;
|
||||
WRAPPER_EXTENSION = octest;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
0FC2647B0DA88EAA00B4CD6B /* Build configuration list for PBXProject "CustomDateMatcher" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
0FC264790DA88EAA00B4CD6B /* Debug */,
|
||||
0FC2647A0DA88EAA00B4CD6B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
0FC264940DA88ECB00B4CD6B /* Build configuration list for PBXNativeTarget "Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
0FC264920DA88ECB00B4CD6B /* Debug */,
|
||||
0FC264930DA88ECB00B4CD6B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0FC264780DA88EAA00B4CD6B /* Project object */;
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.hamcrest.Example</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
#import <OCHamcrest/HCBaseMatcher.h>
|
||||
#import <objc/objc-api.h>
|
||||
|
||||
// Matches dates that fall on a given day of the week.
|
||||
@interface IsGivenDayOfWeek : HCBaseMatcher
|
||||
{
|
||||
NSInteger day; // Sunday is 0, Saturday is 6
|
||||
}
|
||||
|
||||
+ (id)isGivenDayOfWeek:(NSInteger)dayOfWeek;
|
||||
- (id)initWithDay:(NSInteger)dayOfWeek;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
// Factory function to generate Saturday matcher.
|
||||
OBJC_EXPORT id <HCMatcher> onASaturday();
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
#import "IsGivenDayOfWeek.h"
|
||||
#import <OCHamcrest/HCDescription.h>
|
||||
|
||||
@implementation IsGivenDayOfWeek
|
||||
|
||||
+ (id)isGivenDayOfWeek:(NSInteger)dayOfWeek
|
||||
{
|
||||
return [[self alloc] initWithDay:dayOfWeek];
|
||||
}
|
||||
|
||||
- (id)initWithDay:(NSInteger)dayOfWeek
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
day = dayOfWeek;
|
||||
return self;
|
||||
}
|
||||
|
||||
// Test whether item matches.
|
||||
- (BOOL)matches:(id)item
|
||||
{
|
||||
if (![item respondsToSelector:@selector(dayOfWeek)])
|
||||
return NO;
|
||||
|
||||
return [item dayOfWeek] == day;
|
||||
}
|
||||
|
||||
// Describe the matcher.
|
||||
- (void)describeTo:(id <HCDescription>)description
|
||||
{
|
||||
NSString* dayAsString[] =
|
||||
{ @"Sunday", @"Monday", @"Tuesday", @"Wednesday", @"Thursday", @"Friday", @"Saturday" };
|
||||
[[description appendText:@"calendar date falling on "] appendText:dayAsString[day]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
id <HCMatcher> onASaturday()
|
||||
{
|
||||
return [IsGivenDayOfWeek isGivenDayOfWeek:6];
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#import <SenTestingKit/SenTestingKit.h>
|
||||
|
||||
#define HC_SHORTHAND
|
||||
#import <OCHamcrest/OCHamcrest.h>
|
||||
|
||||
#import "IsGivenDayOfWeek.h"
|
||||
|
||||
@interface SampleTest : SenTestCase
|
||||
@end
|
||||
|
||||
@implementation SampleTest
|
||||
|
||||
- (void)testDateIsOnASaturday
|
||||
{
|
||||
// Example of a successful match.
|
||||
NSCalendarDate* date = [NSCalendarDate dateWithString:@"26 Apr 2008" calendarFormat:@"%d %b %Y"];
|
||||
assertThat(date, is(onASaturday()));
|
||||
}
|
||||
|
||||
- (void)testFailsWithMismatchedDate
|
||||
{
|
||||
// Example of what happens with date that doesn't match.
|
||||
NSCalendarDate* date = [NSCalendarDate dateWithString:@"06 Apr 2008" calendarFormat:@"%d %b %Y"];
|
||||
assertThat(date, is(onASaturday()));
|
||||
}
|
||||
|
||||
- (void)testFailsWithNonDate
|
||||
{
|
||||
// Example of what happens with object that isn't a date.
|
||||
NSString* nonDate = @"oops";
|
||||
assertThat(nonDate, is(onASaturday()));
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user