├── .gitignore ├── ConciseKit.podspec ├── ConciseKitSpecs ├── ConciseKitSpecs.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── jihoon.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── jihoon.xcuserdatad │ │ └── xcschemes │ │ ├── ConciseKitSpecs.xcscheme │ │ └── xcschememanagement.plist ├── Frameworks │ ├── Cedar.framework │ │ ├── Cedar │ │ ├── Headers │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── Cedar │ │ │ ├── Headers │ │ │ │ ├── CDRExampleBase.h │ │ │ │ ├── CDRExampleParent.h │ │ │ │ ├── CDRExampleReporter.h │ │ │ │ ├── CDRFunctions.h │ │ │ │ ├── CDRSharedExampleGroupPool.h │ │ │ │ ├── CDRSpec.h │ │ │ │ ├── Cedar.h │ │ │ │ └── SpecHelper.h │ │ │ └── Resources │ │ │ │ └── Info.plist │ │ │ └── Current │ ├── OCHamcrest.framework │ │ ├── Headers │ │ ├── OCHamcrest │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── HCAllOf.h │ │ │ │ ├── HCAnyOf.h │ │ │ │ ├── HCBaseDescription.h │ │ │ │ ├── HCBaseMatcher.h │ │ │ │ ├── HCBoxNumber.h │ │ │ │ ├── HCDescribedAs.h │ │ │ │ ├── HCDescription.h │ │ │ │ ├── HCHasDescription.h │ │ │ │ ├── HCInvocationMatcher.h │ │ │ │ ├── HCIs.h │ │ │ │ ├── HCIsAnything.h │ │ │ │ ├── HCIsCloseTo.h │ │ │ │ ├── HCIsCollectionContaining.h │ │ │ │ ├── HCIsCollectionOnlyContaining.h │ │ │ │ ├── HCIsDictionaryContaining.h │ │ │ │ ├── HCIsDictionaryContainingKey.h │ │ │ │ ├── HCIsDictionaryContainingValue.h │ │ │ │ ├── HCIsEqual.h │ │ │ │ ├── HCIsEqualIgnoringCase.h │ │ │ │ ├── HCIsEqualIgnoringWhiteSpace.h │ │ │ │ ├── HCIsEqualToNumber.h │ │ │ │ ├── HCIsIn.h │ │ │ │ ├── HCIsInstanceOf.h │ │ │ │ ├── HCIsNil.h │ │ │ │ ├── HCIsNot.h │ │ │ │ ├── HCIsSame.h │ │ │ │ ├── HCMatcher.h │ │ │ │ ├── HCMatcherAssert.h │ │ │ │ ├── HCNumberAssert.h │ │ │ │ ├── HCOrderingComparison.h │ │ │ │ ├── HCRequireNonNilString.h │ │ │ │ ├── HCSelfDescribing.h │ │ │ │ ├── HCStringContains.h │ │ │ │ ├── HCStringDescription.h │ │ │ │ ├── HCStringEndsWith.h │ │ │ │ ├── HCStringStartsWith.h │ │ │ │ ├── HCSubstringMatcher.h │ │ │ │ ├── HCWrapInMatcher.h │ │ │ │ └── OCHamcrest.h │ │ │ ├── OCHamcrest │ │ │ └── Resources │ │ │ │ ├── Info.plist │ │ │ │ └── InfoPlist.strings │ │ │ └── Current │ └── OCMock.framework │ │ ├── Headers │ │ ├── OCMock │ │ ├── Resources │ │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── NSNotificationCenter+OCMAdditions.h │ │ │ ├── OCMArg.h │ │ │ ├── OCMConstraint.h │ │ │ ├── OCMock.h │ │ │ ├── OCMockObject.h │ │ │ └── OCMockRecorder.h │ │ ├── OCMock │ │ └── Resources │ │ │ ├── Info.plist │ │ │ └── License.txt │ │ └── Current └── Spec │ ├── ConciseKitSpec.m │ ├── Fixtures │ ├── CKMocks.h │ ├── CKMocks.m │ ├── Foo.h │ └── Foo.m │ ├── NSArrayConciseKitSpec.m │ ├── NSDictionaryConciseKitSpec.m │ ├── NSSetConciseKitSpec.m │ ├── NSStringConciseKitSpec.m │ └── Support │ ├── CedarAdditions.h │ ├── CedarAdditions.m │ ├── ConciseKitSpecs-Info.plist │ ├── ConciseKitSpecsAppDelegate.m │ ├── SpecHelper.h │ ├── Specs.xib │ └── main.m ├── LICENSE ├── README.md └── src ├── CKAdditions.h ├── CKMacros.h ├── CKSingleton.h ├── ConciseKit.h ├── ConciseKit.m ├── NSArray+ConciseKit.h ├── NSArray+ConciseKit.m ├── NSDictionary+ConciseKit.h ├── NSDictionary+ConciseKit.m ├── NSString+ConciseKit.h └── NSString+ConciseKit.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.xcworkspace 3 | xcuserdata 4 | .idea 5 | build/ 6 | *.pbxuser 7 | *.mode1v3 8 | products/* 9 | 10 | -------------------------------------------------------------------------------- /ConciseKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'ConciseKit' 3 | s.version = '0.1.2' 4 | s.license = 'MIT' 5 | s.summary = 'A set of Objective-C additions and macros that lets you write code more quickly.' 6 | s.homepage = 'http://github.com/petejkim/ConciseKit' 7 | s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' } 8 | 9 | s.source = { :git => 'http://github.com/petejkim/ConciseKit.git', :tag => 'v0.1.2' } 10 | 11 | s.source_files = 'src/**/*.{h,m}' 12 | 13 | s.clean_paths = 'ConciseKitSpecs' 14 | 15 | s.frameworks = 'Foundation' 16 | end 17 | 18 | -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB6C70DD14E21B3A0016D5D7 /* NSSetConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = CB6C70DC14E21B3A0016D5D7 /* NSSetConciseKitSpec.m */; }; 11 | E90DAB9D12A66B1D000A36AE /* Foo.m in Sources */ = {isa = PBXBuildFile; fileRef = E90DAB9C12A66B1D000A36AE /* Foo.m */; }; 12 | E90DADE612A6A07A000A36AE /* CKMocks.m in Sources */ = {isa = PBXBuildFile; fileRef = E90DADE512A6A07A000A36AE /* CKMocks.m */; }; 13 | E91C438112985E4F001522E5 /* CedarAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E92CB57F1296E1D800BF1922 /* CedarAdditions.m */; }; 14 | E91C438212985E4F001522E5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E91C436912985C8A001522E5 /* main.m */; }; 15 | E91C438312985E4F001522E5 /* ConciseKitSpecsAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E91C433212985A68001522E5 /* ConciseKitSpecsAppDelegate.m */; }; 16 | E91C438512985E5A001522E5 /* Specs.xib in Resources */ = {isa = PBXBuildFile; fileRef = E91C435D12985BD9001522E5 /* Specs.xib */; }; 17 | E91C43C312985E7D001522E5 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 18 | E91C43C412985E7D001522E5 /* Cedar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4EC1296DF2B00BF1922 /* Cedar.framework */; }; 19 | E91C43C512985E7D001522E5 /* OCHamcrest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */; }; 20 | E91C43C612985E7D001522E5 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4F01296DF2B00BF1922 /* OCMock.framework */; }; 21 | E925015812D92E250018D373 /* NSDictionaryConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E925015712D92E250018D373 /* NSDictionaryConciseKitSpec.m */; }; 22 | E953689A1521C7BA00AA3B81 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = E95368991521C7BA00AA3B81 /* README.md */; }; 23 | E95368B01521CA5A00AA3B81 /* ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E95368A91521CA5A00AA3B81 /* ConciseKit.m */; }; 24 | E95368B11521CA5A00AA3B81 /* NSArray+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E95368AB1521CA5A00AA3B81 /* NSArray+ConciseKit.m */; }; 25 | E95368B21521CA5A00AA3B81 /* NSDictionary+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E95368AD1521CA5A00AA3B81 /* NSDictionary+ConciseKit.m */; }; 26 | E95368B31521CA5A00AA3B81 /* NSString+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E95368AF1521CA5A00AA3B81 /* NSString+ConciseKit.m */; }; 27 | E965CE8C12A17FC400416CDF /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E965CE8A12A17FC400416CDF /* LICENSE */; }; 28 | E965CE9412A1805800416CDF /* NSArrayConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CE9312A1805800416CDF /* NSArrayConciseKitSpec.m */; }; 29 | E965CFC212A18A5000416CDF /* ConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CFC112A18A5000416CDF /* ConciseKitSpec.m */; }; 30 | E9692C2612B4B4FF00520396 /* NSStringConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E9692C2512B4B4FF00520396 /* NSStringConciseKitSpec.m */; }; 31 | E9E4CF061298753B0093F83D /* Cedar.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4EC1296DF2B00BF1922 /* Cedar.framework */; }; 32 | E9E4CF071298753B0093F83D /* OCHamcrest.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */; }; 33 | E9E4CF081298753B0093F83D /* OCMock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4F01296DF2B00BF1922 /* OCMock.framework */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXCopyFilesBuildPhase section */ 37 | E9E4CF32129875740093F83D /* CopyFiles */ = { 38 | isa = PBXCopyFilesBuildPhase; 39 | buildActionMask = 2147483647; 40 | dstPath = ""; 41 | dstSubfolderSpec = 10; 42 | files = ( 43 | E9E4CF061298753B0093F83D /* Cedar.framework in CopyFiles */, 44 | E9E4CF071298753B0093F83D /* OCHamcrest.framework in CopyFiles */, 45 | E9E4CF081298753B0093F83D /* OCMock.framework in CopyFiles */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXCopyFilesBuildPhase section */ 50 | 51 | /* Begin PBXFileReference section */ 52 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 53 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 54 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 55 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 56 | CB6C70DC14E21B3A0016D5D7 /* NSSetConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSSetConciseKitSpec.m; sourceTree = ""; }; 57 | E90DAB9B12A66B1D000A36AE /* Foo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Foo.h; sourceTree = ""; }; 58 | E90DAB9C12A66B1D000A36AE /* Foo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Foo.m; sourceTree = ""; }; 59 | E90DADE412A6A07A000A36AE /* CKMocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKMocks.h; sourceTree = ""; }; 60 | E90DADE512A6A07A000A36AE /* CKMocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CKMocks.m; sourceTree = ""; }; 61 | E91C433212985A68001522E5 /* ConciseKitSpecsAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKitSpecsAppDelegate.m; sourceTree = ""; }; 62 | E91C435B12985B77001522E5 /* ConciseKitSpecs-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ConciseKitSpecs-Info.plist"; sourceTree = ""; }; 63 | E91C435D12985BD9001522E5 /* Specs.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Specs.xib; sourceTree = ""; }; 64 | E91C436912985C8A001522E5 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 65 | E91C437B12985DDD001522E5 /* ConciseKitSpecs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ConciseKitSpecs.app; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | E925015712D92E250018D373 /* NSDictionaryConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionaryConciseKitSpec.m; sourceTree = ""; }; 67 | E92CB4EC1296DF2B00BF1922 /* Cedar.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Cedar.framework; sourceTree = ""; }; 68 | E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OCHamcrest.framework; sourceTree = ""; }; 69 | E92CB4F01296DF2B00BF1922 /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OCMock.framework; sourceTree = ""; }; 70 | E92CB55C1296E0E600BF1922 /* SpecHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecHelper.h; sourceTree = ""; }; 71 | E92CB57E1296E1D800BF1922 /* CedarAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CedarAdditions.h; sourceTree = ""; }; 72 | E92CB57F1296E1D800BF1922 /* CedarAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CedarAdditions.m; sourceTree = ""; }; 73 | E95368991521C7BA00AA3B81 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 74 | E95368A51521CA5A00AA3B81 /* CKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKAdditions.h; sourceTree = ""; }; 75 | E95368A61521CA5A00AA3B81 /* CKMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKMacros.h; sourceTree = ""; }; 76 | E95368A71521CA5A00AA3B81 /* CKSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKSingleton.h; sourceTree = ""; }; 77 | E95368A81521CA5A00AA3B81 /* ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConciseKit.h; sourceTree = ""; }; 78 | E95368A91521CA5A00AA3B81 /* ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKit.m; sourceTree = ""; }; 79 | E95368AA1521CA5A00AA3B81 /* NSArray+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+ConciseKit.h"; sourceTree = ""; }; 80 | E95368AB1521CA5A00AA3B81 /* NSArray+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+ConciseKit.m"; sourceTree = ""; }; 81 | E95368AC1521CA5A00AA3B81 /* NSDictionary+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ConciseKit.h"; sourceTree = ""; }; 82 | E95368AD1521CA5A00AA3B81 /* NSDictionary+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ConciseKit.m"; sourceTree = ""; }; 83 | E95368AE1521CA5A00AA3B81 /* NSString+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ConciseKit.h"; sourceTree = ""; }; 84 | E95368AF1521CA5A00AA3B81 /* NSString+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ConciseKit.m"; sourceTree = ""; }; 85 | E965CE8A12A17FC400416CDF /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 86 | E965CE9312A1805800416CDF /* NSArrayConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArrayConciseKitSpec.m; sourceTree = ""; }; 87 | E965CFC112A18A5000416CDF /* ConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKitSpec.m; sourceTree = ""; }; 88 | E9692C2512B4B4FF00520396 /* NSStringConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStringConciseKitSpec.m; sourceTree = ""; }; 89 | /* End PBXFileReference section */ 90 | 91 | /* Begin PBXFrameworksBuildPhase section */ 92 | E91C437912985DDD001522E5 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | E91C43C312985E7D001522E5 /* Cocoa.framework in Frameworks */, 97 | E91C43C412985E7D001522E5 /* Cedar.framework in Frameworks */, 98 | E91C43C512985E7D001522E5 /* OCHamcrest.framework in Frameworks */, 99 | E91C43C612985E7D001522E5 /* OCMock.framework in Frameworks */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | /* End PBXFrameworksBuildPhase section */ 104 | 105 | /* Begin PBXGroup section */ 106 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | E91C437B12985DDD001522E5 /* ConciseKitSpecs.app */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | 29B97314FDCFA39411CA2CEA /* ConciseKit */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | E95368991521C7BA00AA3B81 /* README.md */, 118 | E965CE8A12A17FC400416CDF /* LICENSE */, 119 | E95368A41521CA5A00AA3B81 /* src */, 120 | E92CB3401296DC6100BF1922 /* Spec */, 121 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 122 | 19C28FACFE9D520D11CA2CBB /* Products */, 123 | ); 124 | name = ConciseKit; 125 | sourceTree = ""; 126 | }; 127 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 131 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 132 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 133 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 134 | E92CB4EC1296DF2B00BF1922 /* Cedar.framework */, 135 | E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */, 136 | E92CB4F01296DF2B00BF1922 /* OCMock.framework */, 137 | ); 138 | path = Frameworks; 139 | sourceTree = ""; 140 | }; 141 | E90DAB9012A66AC3000A36AE /* Fixtures */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | E90DAB9B12A66B1D000A36AE /* Foo.h */, 145 | E90DAB9C12A66B1D000A36AE /* Foo.m */, 146 | E90DADE412A6A07A000A36AE /* CKMocks.h */, 147 | E90DADE512A6A07A000A36AE /* CKMocks.m */, 148 | ); 149 | path = Fixtures; 150 | sourceTree = ""; 151 | }; 152 | E92CB3401296DC6100BF1922 /* Spec */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | E90DAB9012A66AC3000A36AE /* Fixtures */, 156 | E92CB3441296DCAC00BF1922 /* Support */, 157 | E965CFC112A18A5000416CDF /* ConciseKitSpec.m */, 158 | E965CE9312A1805800416CDF /* NSArrayConciseKitSpec.m */, 159 | CB6C70DC14E21B3A0016D5D7 /* NSSetConciseKitSpec.m */, 160 | E925015712D92E250018D373 /* NSDictionaryConciseKitSpec.m */, 161 | E9692C2512B4B4FF00520396 /* NSStringConciseKitSpec.m */, 162 | ); 163 | path = Spec; 164 | sourceTree = ""; 165 | }; 166 | E92CB3441296DCAC00BF1922 /* Support */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | E92CB55C1296E0E600BF1922 /* SpecHelper.h */, 170 | E92CB57E1296E1D800BF1922 /* CedarAdditions.h */, 171 | E92CB57F1296E1D800BF1922 /* CedarAdditions.m */, 172 | E91C436912985C8A001522E5 /* main.m */, 173 | E91C433212985A68001522E5 /* ConciseKitSpecsAppDelegate.m */, 174 | E91C435B12985B77001522E5 /* ConciseKitSpecs-Info.plist */, 175 | E91C435D12985BD9001522E5 /* Specs.xib */, 176 | ); 177 | path = Support; 178 | sourceTree = ""; 179 | }; 180 | E95368A41521CA5A00AA3B81 /* src */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | E95368A51521CA5A00AA3B81 /* CKAdditions.h */, 184 | E95368A61521CA5A00AA3B81 /* CKMacros.h */, 185 | E95368A71521CA5A00AA3B81 /* CKSingleton.h */, 186 | E95368A81521CA5A00AA3B81 /* ConciseKit.h */, 187 | E95368A91521CA5A00AA3B81 /* ConciseKit.m */, 188 | E95368AA1521CA5A00AA3B81 /* NSArray+ConciseKit.h */, 189 | E95368AB1521CA5A00AA3B81 /* NSArray+ConciseKit.m */, 190 | E95368AC1521CA5A00AA3B81 /* NSDictionary+ConciseKit.h */, 191 | E95368AD1521CA5A00AA3B81 /* NSDictionary+ConciseKit.m */, 192 | E95368AE1521CA5A00AA3B81 /* NSString+ConciseKit.h */, 193 | E95368AF1521CA5A00AA3B81 /* NSString+ConciseKit.m */, 194 | ); 195 | name = src; 196 | path = ../src; 197 | sourceTree = ""; 198 | }; 199 | /* End PBXGroup section */ 200 | 201 | /* Begin PBXNativeTarget section */ 202 | E91C437A12985DDD001522E5 /* ConciseKitSpecs */ = { 203 | isa = PBXNativeTarget; 204 | buildConfigurationList = E91C438012985DDE001522E5 /* Build configuration list for PBXNativeTarget "ConciseKitSpecs" */; 205 | buildPhases = ( 206 | E9E4CF32129875740093F83D /* CopyFiles */, 207 | E91C437712985DDD001522E5 /* Resources */, 208 | E91C437812985DDD001522E5 /* Sources */, 209 | E91C437912985DDD001522E5 /* Frameworks */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = ConciseKitSpecs; 216 | productName = ConciseKitSpecs; 217 | productReference = E91C437B12985DDD001522E5 /* ConciseKitSpecs.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | /* End PBXNativeTarget section */ 221 | 222 | /* Begin PBXProject section */ 223 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 224 | isa = PBXProject; 225 | attributes = { 226 | LastUpgradeCheck = 0420; 227 | }; 228 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ConciseKitSpecs" */; 229 | compatibilityVersion = "Xcode 3.2"; 230 | developmentRegion = English; 231 | hasScannedForEncodings = 1; 232 | knownRegions = ( 233 | English, 234 | Japanese, 235 | French, 236 | German, 237 | ); 238 | mainGroup = 29B97314FDCFA39411CA2CEA /* ConciseKit */; 239 | projectDirPath = ""; 240 | projectRoot = ""; 241 | targets = ( 242 | E91C437A12985DDD001522E5 /* ConciseKitSpecs */, 243 | ); 244 | }; 245 | /* End PBXProject section */ 246 | 247 | /* Begin PBXResourcesBuildPhase section */ 248 | E91C437712985DDD001522E5 /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | E91C438512985E5A001522E5 /* Specs.xib in Resources */, 253 | E965CE8C12A17FC400416CDF /* LICENSE in Resources */, 254 | E953689A1521C7BA00AA3B81 /* README.md in Resources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | /* End PBXResourcesBuildPhase section */ 259 | 260 | /* Begin PBXSourcesBuildPhase section */ 261 | E91C437812985DDD001522E5 /* Sources */ = { 262 | isa = PBXSourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | E91C438112985E4F001522E5 /* CedarAdditions.m in Sources */, 266 | E91C438212985E4F001522E5 /* main.m in Sources */, 267 | E91C438312985E4F001522E5 /* ConciseKitSpecsAppDelegate.m in Sources */, 268 | E965CE9412A1805800416CDF /* NSArrayConciseKitSpec.m in Sources */, 269 | E965CFC212A18A5000416CDF /* ConciseKitSpec.m in Sources */, 270 | E90DAB9D12A66B1D000A36AE /* Foo.m in Sources */, 271 | E90DADE612A6A07A000A36AE /* CKMocks.m in Sources */, 272 | E9692C2612B4B4FF00520396 /* NSStringConciseKitSpec.m in Sources */, 273 | E925015812D92E250018D373 /* NSDictionaryConciseKitSpec.m in Sources */, 274 | CB6C70DD14E21B3A0016D5D7 /* NSSetConciseKitSpec.m in Sources */, 275 | E95368B01521CA5A00AA3B81 /* ConciseKit.m in Sources */, 276 | E95368B11521CA5A00AA3B81 /* NSArray+ConciseKit.m in Sources */, 277 | E95368B21521CA5A00AA3B81 /* NSDictionary+ConciseKit.m in Sources */, 278 | E95368B31521CA5A00AA3B81 /* NSString+ConciseKit.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin XCBuildConfiguration section */ 285 | C01FCF4F08A954540054247B /* Debug */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_ENABLE_OBJC_GC = supported; 291 | GCC_OPTIMIZATION_LEVEL = 0; 292 | GCC_TREAT_WARNINGS_AS_ERRORS = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | ONLY_ACTIVE_ARCH = YES; 296 | SDKROOT = macosx; 297 | }; 298 | name = Debug; 299 | }; 300 | C01FCF5008A954540054247B /* Release */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 304 | GCC_C_LANGUAGE_STANDARD = gnu99; 305 | GCC_ENABLE_OBJC_GC = supported; 306 | GCC_TREAT_WARNINGS_AS_ERRORS = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 308 | GCC_WARN_UNUSED_VARIABLE = YES; 309 | SDKROOT = macosx; 310 | }; 311 | name = Release; 312 | }; 313 | E91C437E12985DDD001522E5 /* Debug */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | ARCHS = "$(NATIVE_ARCH_ACTUAL)"; 318 | COPY_PHASE_STRIP = NO; 319 | FRAMEWORK_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "\"$(SRCROOT)/Frameworks\"", 322 | ); 323 | GCC_DYNAMIC_NO_PIC = NO; 324 | GCC_MODEL_TUNING = G5; 325 | GCC_OPTIMIZATION_LEVEL = 0; 326 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 327 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 328 | INFOPLIST_FILE = "Spec/Support/ConciseKitSpecs-Info.plist"; 329 | INSTALL_PATH = "$(HOME)/Applications"; 330 | PRODUCT_NAME = ConciseKitSpecs; 331 | }; 332 | name = Debug; 333 | }; 334 | E91C437F12985DDD001522E5 /* Release */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | ARCHS = "$(NATIVE_ARCH_ACTUAL)"; 339 | COPY_PHASE_STRIP = YES; 340 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 341 | FRAMEWORK_SEARCH_PATHS = ( 342 | "$(inherited)", 343 | "\"$(SRCROOT)/Frameworks\"", 344 | ); 345 | GCC_MODEL_TUNING = G5; 346 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 347 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 348 | INFOPLIST_FILE = "Spec/Support/ConciseKitSpecs-Info.plist"; 349 | INSTALL_PATH = "$(HOME)/Applications"; 350 | PRODUCT_NAME = ConciseKitSpecs; 351 | ZERO_LINK = NO; 352 | }; 353 | name = Release; 354 | }; 355 | /* End XCBuildConfiguration section */ 356 | 357 | /* Begin XCConfigurationList section */ 358 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ConciseKitSpecs" */ = { 359 | isa = XCConfigurationList; 360 | buildConfigurations = ( 361 | C01FCF4F08A954540054247B /* Debug */, 362 | C01FCF5008A954540054247B /* Release */, 363 | ); 364 | defaultConfigurationIsVisible = 0; 365 | defaultConfigurationName = Release; 366 | }; 367 | E91C438012985DDE001522E5 /* Build configuration list for PBXNativeTarget "ConciseKitSpecs" */ = { 368 | isa = XCConfigurationList; 369 | buildConfigurations = ( 370 | E91C437E12985DDD001522E5 /* Debug */, 371 | E91C437F12985DDD001522E5 /* Release */, 372 | ); 373 | defaultConfigurationIsVisible = 0; 374 | defaultConfigurationName = Release; 375 | }; 376 | /* End XCConfigurationList section */ 377 | }; 378 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 379 | } 380 | -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petejkim/ConciseKit/4a70ea47856c3b0698f8330f19a557295068940e/ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/ConciseKitSpecs.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 67 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /ConciseKitSpecs/ConciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ConciseKitSpecs.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E91C437A12985DDD001522E5 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Cedar: -------------------------------------------------------------------------------- 1 | Versions/Current/Cedar -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Cedar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petejkim/ConciseKit/4a70ea47856c3b0698f8330f19a557295068940e/ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Cedar -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRExampleBase.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CDRExampleParent.h" 3 | 4 | @protocol CDRExampleReporter; 5 | 6 | typedef void (^CDRSpecBlock)(void); 7 | 8 | enum CDRExampleState { 9 | CDRExampleStateIncomplete = 0x00, 10 | CDRExampleStatePassed = 0x01, 11 | CDRExampleStatePending = 0x03, 12 | CDRExampleStateFailed = 0x07, 13 | CDRExampleStateError = 0x0F 14 | }; 15 | typedef enum CDRExampleState CDRExampleState; 16 | 17 | @interface CDRSpecFailure : NSException 18 | + (id)specFailureWithReason:(NSString *)reason; 19 | @end 20 | 21 | @interface CDRExampleBase : NSObject { 22 | NSString *text_; 23 | id parent_; 24 | } 25 | 26 | @property (nonatomic, readonly) NSString *text; 27 | @property (nonatomic, assign) id parent; 28 | 29 | - (id)initWithText:(NSString *)text; 30 | 31 | - (void)run; 32 | - (BOOL)hasChildren; 33 | - (NSString *)message; 34 | - (NSString *)fullText; 35 | @end 36 | 37 | @interface CDRExampleBase (RunReporting) 38 | - (CDRExampleState)state; 39 | - (float)progress; 40 | @end 41 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRExampleParent.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol CDRExampleParent 4 | 5 | - (void)setUp; 6 | - (void)tearDown; 7 | 8 | @optional 9 | - (BOOL)hasFullText; 10 | - (NSString *)fullText; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRExampleReporter.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol CDRExampleReporter 4 | 5 | - (void)runWillStartWithGroups:(NSArray *)groups; 6 | - (void)runDidComplete; 7 | - (int)result; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRFunctions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol CDRExampleReporter; 4 | 5 | int runSpecsWithCustomExampleReporter(NSArray *specClasses, id runner); 6 | int runAllSpecs(); 7 | int runAllSpecsWithCustomExampleReporter(id runner); 8 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRSharedExampleGroupPool.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol CDRSharedExampleGroupPool 4 | @end 5 | 6 | typedef void (^CDRSharedExampleGroupBlock)(NSDictionary *); 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | void sharedExamplesFor(NSString *, CDRSharedExampleGroupBlock); 12 | void itShouldBehaveLike(NSString *); 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | @interface CDRSharedExampleGroupPool : NSObject 18 | @end 19 | 20 | @interface CDRSharedExampleGroupPool (SharedExampleGroupDeclaration) 21 | - (void)declareSharedExampleGroups; 22 | @end 23 | 24 | #define SHARED_EXAMPLE_GROUPS_BEGIN(name) \ 25 | @interface SharedExampleGroupPoolFor##name : CDRSharedExampleGroupPool \ 26 | @end \ 27 | @implementation SharedExampleGroupPoolFor##name \ 28 | - (void)declareSharedExampleGroups { 29 | 30 | #define SHARED_EXAMPLE_GROUPS_END \ 31 | } \ 32 | @end 33 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/CDRSpec.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CDRExampleBase.h" 3 | 4 | @protocol CDRExampleReporter; 5 | @class CDRExampleGroup, SpecHelper; 6 | 7 | @protocol CDRSpec 8 | @end 9 | 10 | extern CDRSpecBlock PENDING; 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | void describe(NSString *, CDRSpecBlock); 16 | void beforeEach(CDRSpecBlock); 17 | void afterEach(CDRSpecBlock); 18 | void it(NSString *, CDRSpecBlock); 19 | void fail(NSString *); 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | @interface CDRSpec : NSObject { 25 | CDRExampleGroup *rootGroup_; 26 | CDRExampleGroup *currentGroup_; 27 | } 28 | 29 | @property (nonatomic, retain) CDRExampleGroup *currentGroup, *rootGroup; 30 | - (void)defineBehaviors; 31 | @end 32 | 33 | @interface CDRSpec (SpecDeclaration) 34 | - (void)declareBehaviors; 35 | @end 36 | 37 | #define SPEC_BEGIN(name) \ 38 | @interface name : CDRSpec \ 39 | @end \ 40 | @implementation name \ 41 | - (void)declareBehaviors { 42 | 43 | #define SPEC_END \ 44 | } \ 45 | @end 46 | 47 | #define DESCRIBE(name) \ 48 | @interface name##Spec : CDRSpec \ 49 | @end \ 50 | @implementation name##Spec \ 51 | - (void)declareBehaviors 52 | 53 | #define DESCRIBE_END \ 54 | @end 55 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/Cedar.h: -------------------------------------------------------------------------------- 1 | #if TARGET_OS_IPHONE 2 | #import "CDRFunctions.h" 3 | #import "CedarApplicationDelegate.h" 4 | #import "CDRExampleReporterViewController.h" 5 | #else 6 | #import "CDRFunctions.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Headers/SpecHelper.h: -------------------------------------------------------------------------------- 1 | #import "CDRSpec.h" 2 | #import "CDRSharedExampleGroupPool.h" 3 | #import "CDRExampleParent.h" 4 | 5 | @interface SpecHelper : NSObject { 6 | NSMutableDictionary *sharedExampleGroups_, *sharedExampleContext_; 7 | } 8 | 9 | @property (nonatomic, retain, readonly) NSMutableDictionary *sharedExampleContext; 10 | 11 | + (SpecHelper *)specHelper; 12 | 13 | - (void)beforeEach; 14 | - (void)afterEach; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | Cedar 9 | CFBundleIdentifier 10 | com.yourcompany.Cedar 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/Cedar.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/OCHamcrest: -------------------------------------------------------------------------------- 1 | Versions/Current/OCHamcrest -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCAllOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAllOf.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Calculates the logical conjunction of multiple matchers. 14 | 15 | Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returns 16 | @c NO. 17 | */ 18 | @interface HCAllOf : HCBaseMatcher 19 | { 20 | NSArray* matchers; 21 | } 22 | 23 | + (HCAllOf*) allOf:(NSArray*)theMatchers; 24 | - (id) initWithMatchers:(NSArray*)theMatchers; 25 | 26 | @end 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /** 34 | Evaluates to @c YES only if @b all of the passed in matchers evaluate to @c YES. 35 | 36 | @param matcher Comma-separated list of matchers ending with @c nil. 37 | */ 38 | id HC_allOf(id matcher, ...); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | 45 | #ifdef HC_SHORTHAND 46 | 47 | /** 48 | Shorthand for HC_allOf, available if HC_SHORTHAND is defined. 49 | */ 50 | #define allOf HC_allOf 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCAnyOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCAnyOf.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Calculates the logical disjunction of multiple matchers. 14 | 15 | Evaluation is shortcut, so the subsequent matchers are not called if an earlier matcher returns 16 | @c YES. 17 | */ 18 | @interface HCAnyOf : HCBaseMatcher 19 | { 20 | NSArray* matchers; 21 | } 22 | 23 | + (HCAnyOf*) anyOf:(NSArray*)theMatchers; 24 | - (id) initWithMatchers:(NSArray*)theMatchers; 25 | 26 | @end 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /** 34 | Evaluates to @c YES if @b any of the passed in matchers evaluate to @c YES. 35 | 36 | @param matcher Comma-separated list of matchers ending with @c nil. 37 | */ 38 | id HC_anyOf(id matcher, ...); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | 45 | #ifdef HC_SHORTHAND 46 | 47 | /** 48 | Shorthand for HC_anyOf, available if HC_SHORTHAND is defined. 49 | */ 50 | #define anyOf HC_anyOf 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCBaseDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseDescription.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | #import "HCDescription.h" 11 | 12 | 13 | /** 14 | Base class for all HCDescription implementations. 15 | */ 16 | @interface HCBaseDescription : NSObject 17 | @end 18 | 19 | 20 | /** 21 | Methods that must be provided by subclasses of HCBaseDescription. 22 | */ 23 | @interface HCBaseDescription (SubclassMustImplement) 24 | 25 | /** 26 | Append the string @a str to the description. 27 | */ 28 | - (void) append:(NSString*)str; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCBaseMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBaseMatcher.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | #import "HCMatcher.h" 11 | 12 | 13 | /** 14 | Base class for all Matcher implementations. 15 | 16 | Most implementations can just implement matches: and let matches:describingMismatchTo: call 17 | it. But if it makes more sense to generate the mismatch description during the matching, 18 | override matches:describingMismatchTo: and have matches: call it with a nil description. 19 | */ 20 | @interface HCBaseMatcher : NSObject 21 | @end 22 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCBoxNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCBoxNumber.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #ifdef __cplusplus 9 | 10 | namespace hamcrest { 11 | 12 | /** 13 | Boxes scalar value in NSNumber, specialized per type. 14 | */ 15 | template 16 | inline 17 | NSNumber* boxNumber(T value) 18 | { return nil; } 19 | 20 | template <> 21 | inline 22 | NSNumber* boxNumber(BOOL value) 23 | { return [NSNumber numberWithBool:value]; } 24 | 25 | template <> 26 | inline 27 | NSNumber* boxNumber(char value) 28 | { return [NSNumber numberWithChar:value]; } 29 | 30 | template <> 31 | inline 32 | NSNumber* boxNumber(double value) 33 | { return [NSNumber numberWithDouble:value]; } 34 | 35 | template <> 36 | inline 37 | NSNumber* boxNumber(float value) 38 | { return [NSNumber numberWithFloat:value]; } 39 | 40 | template <> 41 | inline 42 | NSNumber* boxNumber(int value) 43 | { return [NSNumber numberWithInt:value]; } 44 | 45 | template <> 46 | inline 47 | NSNumber* boxNumber(long value) 48 | { return [NSNumber numberWithLong:value]; } 49 | 50 | template <> 51 | inline 52 | NSNumber* boxNumber(long long value) 53 | { return [NSNumber numberWithLongLong:value]; } 54 | 55 | template <> 56 | inline 57 | NSNumber* boxNumber(short value) 58 | { return [NSNumber numberWithShort:value]; } 59 | 60 | template <> 61 | inline 62 | NSNumber* boxNumber(unsigned char value) 63 | { return [NSNumber numberWithUnsignedChar:value]; } 64 | 65 | template <> 66 | inline 67 | NSNumber* boxNumber(unsigned int value) 68 | { return [NSNumber numberWithUnsignedInt:value]; } 69 | 70 | template <> 71 | inline 72 | NSNumber* boxNumber(unsigned long value) 73 | { return [NSNumber numberWithUnsignedLong:value]; } 74 | 75 | template <> 76 | inline 77 | NSNumber* boxNumber(unsigned long long value) 78 | { return [NSNumber numberWithUnsignedLongLong:value]; } 79 | 80 | template <> 81 | inline 82 | NSNumber* boxNumber(unsigned short value) 83 | { return [NSNumber numberWithUnsignedShort:value]; } 84 | 85 | } // namespace hamcrest 86 | 87 | #endif // __cplusplus 88 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCDescribedAs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescribedAs.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Provides a custom description to another matcher. 14 | */ 15 | @interface HCDescribedAs : HCBaseMatcher 16 | { 17 | NSString* descriptionTemplate; 18 | id matcher; 19 | NSArray* values; 20 | } 21 | 22 | + (HCDescribedAs*) describedAs:(NSString*)description 23 | forMatcher:(id)aMatcher 24 | overValues:(NSArray*)templateValues; 25 | - (id) initWithDescription:(NSString*)description 26 | forMatcher:(id)aMatcher 27 | overValues:(NSArray*)templateValues; 28 | 29 | @end 30 | 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | Wraps an existing matcher and overrides the description when it fails. 38 | 39 | Optional values following the matcher are substituted for \%0, \%1, etc. 40 | The last argument must be nil. 41 | */ 42 | id HC_describedAs(NSString* description, id matcher, ...); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | 49 | #ifdef HC_SHORTHAND 50 | 51 | /** 52 | Shorthand for HC_describedAs, available if HC_SHORTHAND is defined. 53 | */ 54 | #define describedAs HC_describedAs 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCDescription.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Mac 9 | #import 10 | 11 | @protocol HCSelfDescribing; 12 | 13 | 14 | /** 15 | A description of an HCMatcher. 16 | 17 | An HCMatcher will describe itself to a description which can later be used for reporting. 18 | */ 19 | @protocol HCDescription 20 | 21 | /** 22 | Appends some plain text to the description. 23 | 24 | @return self 25 | */ 26 | - (id) appendText:(NSString*)text; 27 | 28 | /** 29 | Appends description of HCSelfDescribing value to self. 30 | 31 | @return self 32 | */ 33 | - (id) appendDescriptionOf:(id)value; 34 | 35 | /** 36 | Appends an arbitary value to the description. 37 | */ 38 | - (id) appendValue:(id)value; 39 | 40 | /** 41 | Appends a list of objects to the description. 42 | */ 43 | - (id) appendList:(NSArray*)values 44 | start:(NSString*)start separator:(NSString*)separator end:(NSString*)end; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCHasDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCHasDescription.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCInvocationMatcher.h" 10 | 11 | 12 | /** 13 | Does the object's description satisfy a given matcher? 14 | */ 15 | @interface HCHasDescription : HCInvocationMatcher 16 | { 17 | } 18 | 19 | + (HCHasDescription*) hasDescription:(id)descriptionMatcher; 20 | - (id) initWithDescription:(id)descriptionMatcher; 21 | 22 | @end 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /** 30 | Evaluates whether [item description] satisfies a given matcher. 31 | 32 | Example: hasDescription(equalTo(result)) 33 | */ 34 | id HC_hasDescription(id item); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | 41 | #ifdef HC_SHORTHAND 42 | 43 | /** 44 | Shorthand for HC_hasDescription, available if HC_SHORTHAND is defined. 45 | */ 46 | #define hasDescription HC_hasDescription 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCInvocationMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCInvocationMatcher.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Supporting class for matching a feature of an object. 14 | 15 | Tests whether the result of passing a given invocation to the value satisfies a given matcher. 16 | */ 17 | @interface HCInvocationMatcher : HCBaseMatcher 18 | { 19 | NSInvocation* invocation; 20 | id subMatcher; 21 | } 22 | 23 | /** 24 | Helper method for creating an invocation. 25 | 26 | A class is specified only so we can determine the method signature. 27 | */ 28 | + (NSInvocation*) createInvocationForSelector:(SEL)selector onClass:(Class)aClass; 29 | 30 | - (id) initWithInvocation:(NSInvocation*)anInvocation matching:(id)aMatcher; 31 | 32 | /** 33 | Returns string representation of the invocation's selector. 34 | */ 35 | - (NSString*) stringFromSelector; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIs.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIs.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Decorates another HCMatcher, retaining the behavior but allowing tests to be slightly more 14 | expressive. 15 | 16 | For example: 17 | @code 18 | assertThat(cheese, equalTo(smelly)) 19 | @endcode 20 | vs. 21 | @code 22 | assertThat(cheese, is(equalTo(smelly))) 23 | @endcode 24 | */ 25 | @interface HCIs : HCBaseMatcher 26 | { 27 | id matcher; 28 | } 29 | 30 | + (HCIs*) is:(id)aMatcher; 31 | - (id) initWithMatcher:(id)aMatcher; 32 | 33 | @end 34 | 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | Decorates an item, providing shortcuts to the frequently used is(equalTo(x)). 42 | 43 | For example: 44 | @code 45 | assertThat(cheese, is(equalTo(smelly))) 46 | @endcode 47 | vs. 48 | @code 49 | assertThat(cheese, is(smelly)) 50 | @endcode 51 | */ 52 | id HC_is(id item); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | 59 | #ifdef HC_SHORTHAND 60 | 61 | /** 62 | Shorthand for HC_is, available if HC_SHORTHAND is defined. 63 | */ 64 | #define is HC_is 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsAnything.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsAnything.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | A matcher that always returns @c YES. 14 | */ 15 | @interface HCIsAnything : HCBaseMatcher 16 | { 17 | NSString* description; 18 | } 19 | 20 | + (HCIsAnything*) isAnything; 21 | + (HCIsAnything*) isAnythingWithDescription:(NSString*)aDescription; 22 | - (id) init; 23 | - (id) initWithDescription:(NSString*)aDescription; 24 | 25 | @end 26 | 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /** 33 | This matcher always evaluates to @c YES. 34 | */ 35 | id HC_anything(); 36 | 37 | /** 38 | This matcher always evaluates to YES. 39 | 40 | @param aDescription A meaningful string used when describing itself. 41 | */ 42 | id HC_anythingWithDescription(NSString* aDescription); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | 49 | #ifdef HC_SHORTHAND 50 | 51 | /** 52 | Shorthand for HC_anything, available if HC_SHORTHAND is defined. 53 | */ 54 | #define anything HC_anything 55 | 56 | /** 57 | Shorthand for HC_anythingWithDescription, available if HC_SHORTHAND is defined. 58 | */ 59 | #define anythingWithDescription HC_anythingWithDescription 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsCloseTo.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCloseTo.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Is the value a number equal to a value within some range of acceptable error? 14 | */ 15 | @interface HCIsCloseTo : HCBaseMatcher 16 | { 17 | double value; 18 | double error; 19 | } 20 | 21 | + (HCIsCloseTo*) isCloseTo:(double)aValue within:(double)anError; 22 | - (id) initWithValue:(double)aValue error:(double)anError; 23 | 24 | @end 25 | 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /** 32 | Is the value a number equal to a value within some range of acceptable error? 33 | */ 34 | id HC_closeTo(double aValue, double anError); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | 41 | #ifdef HC_SHORTHAND 42 | 43 | /** 44 | Shorthand for HC_closeTo, available if HC_SHORTHAND is defined. 45 | */ 46 | #define closeTo HC_closeTo 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsCollectionContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionContaining.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCIsCollectionContaining : HCBaseMatcher 13 | { 14 | id elementMatcher; 15 | } 16 | 17 | + (HCIsCollectionContaining*) isCollectionContaining:(id)anElementMatcher; 18 | - (id) initWithMatcher:(id)anElementMatcher; 19 | 20 | @end 21 | 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | id HC_hasItem(id item); 28 | 29 | /** 30 | @param item comma-separated list of items ending with nil. 31 | */ 32 | id HC_hasItems(id item, ...); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | 39 | #ifdef HC_SHORTHAND 40 | 41 | /** 42 | Shorthand for HC_hasItem, available if HC_SHORTHAND is defined. 43 | */ 44 | #define hasItem HC_hasItem 45 | 46 | /** 47 | Shorthand for HC_hasItems, available if HC_SHORTHAND is defined. 48 | */ 49 | #define hasItems HC_hasItems 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsCollectionOnlyContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsCollectionOnlyContaining.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Matches collections that only contain elements satisfying a given matcher. 14 | 15 | This matcher will never match an empty collection. 16 | */ 17 | @interface HCIsCollectionOnlyContaining : HCBaseMatcher 18 | { 19 | id matcher; 20 | } 21 | 22 | + (HCIsCollectionOnlyContaining*) isCollectionOnlyContaining:(id)aMatcher; 23 | - (id) initWithMatcher:(id)aMatcher; 24 | 25 | @end 26 | 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /** 33 | Matches collections that only contain elements satisfying any of a list of items. 34 | 35 | For example, 36 | [NSArray arrayWithObjects:@"a", "b", @"c", nil] 37 | would satisfy 38 | onlyContains(lessThan(@"d"), nil). 39 | 40 | If an item is not a matcher, it is equivalent to equalTo(item), so the array in the example 41 | above would also satisfy 42 | onlyContains(@"a", @"b", @"c", nil). 43 | 44 | @param item comma-separated list of items ending with nil. 45 | */ 46 | id HC_onlyContains(id item, ...); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | 53 | #ifdef HC_SHORTHAND 54 | 55 | /** 56 | Shorthand for HC_onlyContains, available if HC_SHORTHAND is defined. 57 | */ 58 | #define onlyContains HC_onlyContains 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsDictionaryContaining.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContaining.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCIsDictionaryContaining : HCBaseMatcher 13 | { 14 | id keyMatcher; 15 | id valueMatcher; 16 | } 17 | 18 | + (HCIsDictionaryContaining*) isDictionaryContainingKey:(id)theKeyMatcher 19 | value:(id)theValueMatcher; 20 | - (id) initWithKeyMatcher:(id)theKeyMatcher valueMatcher:(id)theValueMatcher; 21 | 22 | @end 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | id HC_hasEntry(id key, id value); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | 36 | #ifdef HC_SHORTHAND 37 | 38 | /** 39 | Shorthand for HC_hasEntry, available if HC_SHORTHAND is defined. 40 | */ 41 | #define hasEntry HC_hasEntry 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsDictionaryContainingKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingKey.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCIsDictionaryContainingKey : HCBaseMatcher 13 | { 14 | id keyMatcher; 15 | } 16 | 17 | + (HCIsDictionaryContainingKey*) isDictionaryContainingKey:(id)theKeyMatcher; 18 | - (id) initWithKeyMatcher:(id)theKeyMatcher; 19 | 20 | @end 21 | 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | id HC_hasKey(id item); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | 34 | #ifdef HC_SHORTHAND 35 | 36 | /** 37 | Shorthand for HC_hasKey, available if HC_SHORTHAND is defined. 38 | */ 39 | #define hasKey HC_hasKey 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsDictionaryContainingValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsDictionaryContainingValue.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCIsDictionaryContainingValue : HCBaseMatcher 13 | { 14 | id valueMatcher; 15 | } 16 | 17 | + (HCIsDictionaryContainingValue*) isDictionaryContainingValue:(id)theValueMatcher; 18 | - (id) initWithValueMatcher:(id)theValueMatcher; 19 | 20 | @end 21 | 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | id HC_hasValue(id item); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | 34 | #ifdef HC_SHORTHAND 35 | 36 | /** 37 | Shorthand for HC_hasValue, available if HC_SHORTHAND is defined. 38 | */ 39 | #define hasValue HC_hasValue 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsEqual.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqual.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Is the object equal to another object, as tested by the isEqual: method? 14 | */ 15 | @interface HCIsEqual : HCBaseMatcher 16 | { 17 | id object; 18 | } 19 | 20 | + (HCIsEqual*) isEqualTo:(id)equalArg; 21 | - (id) initEqualTo:(id)equalArg; 22 | 23 | @end 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | Is the object equal to another object, as tested by the isEqual: method? 32 | */ 33 | id HC_equalTo(id equalArg); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | 40 | #ifdef HC_SHORTHAND 41 | 42 | /** 43 | Shorthand for HC_equalTo, available if HC_SHORTHAND is defined. 44 | */ 45 | #define equalTo HC_equalTo 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsEqualIgnoringCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringCase.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Tests if a string is equal to another string, regardless of the case. 14 | */ 15 | @interface HCIsEqualIgnoringCase : HCBaseMatcher 16 | { 17 | NSString* string; 18 | } 19 | 20 | + (HCIsEqualIgnoringCase*) isEqualIgnoringCase:(NSString*)aString; 21 | - (id) initWithString:(NSString*)aString; 22 | 23 | @end 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | id HC_equalToIgnoringCase(NSString* aString); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #ifdef HC_SHORTHAND 38 | 39 | /** 40 | Shorthand for HC_endsWith, available if HC_SHORTHAND is defined. 41 | */ 42 | #define equalToIgnoringCase HC_equalToIgnoringCase 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsEqualIgnoringWhiteSpace.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualIgnoringWhiteSpace.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Tests if a string is equal to another string, ignoring any changes in whitespace. 14 | */ 15 | @interface HCIsEqualIgnoringWhiteSpace : HCBaseMatcher 16 | { 17 | NSString* originalString; 18 | NSString* strippedString; 19 | } 20 | 21 | + (HCIsEqualIgnoringWhiteSpace*) isEqualIgnoringWhiteSpace:(NSString*)aString; 22 | - (id) initWithString:(NSString*)aString; 23 | 24 | @end 25 | 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | id HC_equalToIgnoringWhiteSpace(NSString* aString); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | 38 | #ifdef HC_SHORTHAND 39 | 40 | /** 41 | Shorthand for HC_endsWith, available if HC_SHORTHAND is defined. 42 | */ 43 | #define equalToIgnoringWhiteSpace HC_equalToIgnoringWhiteSpace 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsEqualToNumber.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsEqualToNumber.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | Is the value, when converted to an NSNumber, equal to another object? 18 | */ 19 | id HC_equalToBool(BOOL value); 20 | 21 | /** 22 | Is the value, when converted to an NSNumber, equal to another object? 23 | */ 24 | id HC_equalToChar(char value); 25 | 26 | /** 27 | Is the value, when converted to an NSNumber, equal to another object? 28 | */ 29 | id HC_equalToDouble(double value); 30 | 31 | /** 32 | Is the value, when converted to an NSNumber, equal to another object? 33 | */ 34 | id HC_equalToFloat(float value); 35 | 36 | /** 37 | Is the value, when converted to an NSNumber, equal to another object? 38 | */ 39 | id HC_equalToInt(int value); 40 | 41 | /** 42 | Is the value, when converted to an NSNumber, equal to another object? 43 | */ 44 | id HC_equalToLong(long value); 45 | 46 | /** 47 | Is the value, when converted to an NSNumber, equal to another object? 48 | */ 49 | id HC_equalToLongLong(long long value); 50 | 51 | /** 52 | Is the value, when converted to an NSNumber, equal to another object? 53 | */ 54 | id HC_equalToShort(short value); 55 | 56 | /** 57 | Is the value, when converted to an NSNumber, equal to another object? 58 | */ 59 | id HC_equalToUnsignedChar(unsigned char value); 60 | 61 | /** 62 | Is the value, when converted to an NSNumber, equal to another object? 63 | */ 64 | id HC_equalToUnsignedInt(unsigned int value); 65 | 66 | /** 67 | Is the value, when converted to an NSNumber, equal to another object? 68 | */ 69 | id HC_equalToUnsignedLong(unsigned long value); 70 | 71 | /** 72 | Is the value, when converted to an NSNumber, equal to another object? 73 | */ 74 | id HC_equalToUnsignedLongLong(unsigned long long value); 75 | 76 | /** 77 | Is the value, when converted to an NSNumber, equal to another object? 78 | */ 79 | id HC_equalToUnsignedShort(unsigned short value); 80 | 81 | 82 | #if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2 83 | 84 | /** 85 | Is the value, when converted to an NSNumber, equal to another object? 86 | */ 87 | id HC_equalToInteger(NSInteger value); 88 | 89 | /** 90 | Is the value, when converted to an NSNumber, equal to another object? 91 | */ 92 | id HC_equalToUnsignedInteger(NSUInteger value); 93 | 94 | #endif // Objective-C 2.0 95 | 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | 102 | #ifdef HC_SHORTHAND 103 | 104 | /** 105 | Shorthand for HC_equalToBool, available if HC_SHORTHAND is defined. 106 | */ 107 | #define equalToBool HC_equalToBool 108 | 109 | /** 110 | Shorthand for HC_equalToChar, available if HC_SHORTHAND is defined. 111 | */ 112 | #define equalToChar HC_equalToChar 113 | 114 | /** 115 | Shorthand for HC_equalToDouble, available if HC_SHORTHAND is defined. 116 | */ 117 | #define equalToDouble HC_equalToDouble 118 | 119 | /** 120 | Shorthand for HC_equalToFloat, available if HC_SHORTHAND is defined. 121 | */ 122 | #define equalToFloat HC_equalToFloat 123 | 124 | /** 125 | Shorthand for HC_equalToInt, available if HC_SHORTHAND is defined. 126 | */ 127 | #define equalToInt HC_equalToInt 128 | 129 | /** 130 | Shorthand for HC_equalToLong, available if HC_SHORTHAND is defined. 131 | */ 132 | #define equalToLong HC_equalToLong 133 | 134 | /** 135 | Shorthand for HC_equalToLongLong, available if HC_SHORTHAND is defined. 136 | */ 137 | #define equalToLongLong HC_equalToLongLong 138 | 139 | /** 140 | Shorthand for HC_equalToShort, available if HC_SHORTHAND is defined. 141 | */ 142 | #define equalToShort HC_equalToShort 143 | 144 | /** 145 | Shorthand for HC_equalToUnsignedChar, available if HC_SHORTHAND is defined. 146 | */ 147 | #define equalToUnsignedChar HC_equalToUnsignedChar 148 | 149 | /** 150 | Shorthand for HC_equalToUnsignedInt, available if HC_SHORTHAND is defined. 151 | */ 152 | #define equalToUnsignedInt HC_equalToUnsignedInt 153 | 154 | /** 155 | Shorthand for HC_equalToUnsignedLong, available if HC_SHORTHAND is defined. 156 | */ 157 | #define equalToUnsignedLong HC_equalToUnsignedLong 158 | 159 | /** 160 | Shorthand for HC_equalToUnsignedLongLong, available if HC_SHORTHAND is defined. 161 | */ 162 | #define equalToUnsignedLongLong HC_equalToUnsignedLongLong 163 | 164 | /** 165 | Shorthand for HC_equalToUnsignedShort, available if HC_SHORTHAND is defined. 166 | */ 167 | #define equalToUnsignedShort HC_equalToUnsignedShort 168 | 169 | 170 | #if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2 171 | 172 | /** 173 | Shorthand for HC_equalToInteger, available if HC_SHORTHAND is defined. 174 | */ 175 | #define equalToInteger HC_equalToInteger 176 | 177 | /** 178 | Shorthand for HC_equalToUnsignedInteger, available if HC_SHORTHAND is defined. 179 | */ 180 | #define equalToUnsignedInteger HC_equalToUnsignedInteger 181 | 182 | #endif // Objective-C 2.0 183 | 184 | 185 | #endif // HC_SHORTHAND 186 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsIn.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsIn.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCIsIn : HCBaseMatcher 13 | { 14 | id collection; 15 | } 16 | 17 | + (HCIsIn*) isInCollection:(id)aCollection; 18 | - (id) initWithCollection:(id)aCollection; 19 | 20 | @end 21 | 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | id HC_isIn(id collection); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | 34 | #ifdef HC_SHORTHAND 35 | 36 | /** 37 | Shorthand for HC_isIn, available if HC_SHORTHAND is defined. 38 | */ 39 | #define isIn HC_isIn 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsInstanceOf.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsInstanceOf.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Tests whether the value is an instance of a class (including subclasses). 14 | */ 15 | @interface HCIsInstanceOf : HCBaseMatcher 16 | { 17 | Class theClass; 18 | } 19 | 20 | + (HCIsInstanceOf*) isInstanceOf:(Class)type; 21 | - (id) initWithType:(Class)type; 22 | 23 | @end 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | Is the value an instance of a particular type? 32 | */ 33 | id HC_instanceOf(Class type); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | 40 | #ifdef HC_SHORTHAND 41 | 42 | /** 43 | Shorthand for HC_instanceOf, available if HC_SHORTHAND is defined. 44 | */ 45 | #define instanceOf HC_instanceOf 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsNil.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNil.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Is the value @c nil? 14 | */ 15 | @interface HCIsNil : HCBaseMatcher 16 | { 17 | } 18 | 19 | + (HCIsNil*) isNil; 20 | 21 | @end 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | Matches if the value is @c nil. 30 | */ 31 | id HC_nilValue(); 32 | 33 | /** 34 | Matches if the value is not @c nil. 35 | */ 36 | id HC_notNilValue(); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | 43 | #ifdef HC_SHORTHAND 44 | 45 | /** 46 | Shorthand for HC_nilValue, available if HC_SHORTHAND is defined. 47 | */ 48 | #define nilValue HC_nilValue 49 | 50 | /** 51 | Shorthand for HC_notNilValue, available if HC_SHORTHAND is defined. 52 | */ 53 | #define notNilValue HC_notNilValue 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsNot.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsNot.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Calculates the logical negation of a matcher. 14 | */ 15 | @interface HCIsNot : HCBaseMatcher 16 | { 17 | id matcher; 18 | } 19 | 20 | + (HCIsNot*) isNot:(id)aMatcher; 21 | - (id) initNot:(id)aMatcher; 22 | 23 | @end 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | Inverts the rule, providing a shortcut to the frequently used isNot(equalTo(x)). 32 | 33 | For example: 34 | @code 35 | assertThat(cheese, isNot(equalTo(smelly))) 36 | @endcode 37 | vs. 38 | @code 39 | assertThat(cheese, isNot(smelly)) 40 | @endcode 41 | */ 42 | id HC_isNot(id item); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | 49 | #ifdef HC_SHORTHAND 50 | 51 | /** 52 | Shorthand for HC_isNot, available if HC_SHORTHAND is defined. 53 | */ 54 | #define isNot HC_isNot 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCIsSame.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCIsSame.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | /** 13 | Is the value the same object as another value? 14 | */ 15 | @interface HCIsSame : HCBaseMatcher 16 | { 17 | id object; 18 | } 19 | 20 | + (HCIsSame*) isSameAs:(id)anObject; 21 | - (id) initSameAs:(id)anObject; 22 | 23 | @end 24 | 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /** 31 | Evaluates to @c YES only when the argument is this same object. 32 | */ 33 | id HC_sameInstance(id anObject); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | 40 | #ifdef HC_SHORTHAND 41 | 42 | /** 43 | Shorthand for HC_sameInstance, available if HC_SHORTHAND is defined. 44 | */ 45 | #define sameInstance HC_sameInstance 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCMatcher.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCSelfDescribing.h" 10 | 11 | 12 | /** 13 | A matcher over acceptable values. 14 | 15 | A matcher is able to describe itself to give feedback when it fails. 16 | 17 | HCMatcher implementations should @b not directly implement this protocol. 18 | Instead, @b extend the HCBaseMatcher class, which will ensure that the HCMatcher API can grow 19 | to support new features and remain compatible with all HCMatcher implementations. 20 | */ 21 | @protocol HCMatcher 22 | 23 | /** 24 | Evaluates the matcher for argument @a item. 25 | 26 | @param item The object against which the matcher is evaluated. 27 | @return @c YES if @a item matches, otherwise @c NO. 28 | */ 29 | - (BOOL) matches:(id)item; 30 | 31 | /** 32 | Evaluates the matcher for argument @a item. 33 | 34 | @param item The object against which the matcher is evaluated. 35 | @param mismatchDescription The description to be built or appended to if @item does not match. 36 | @return @c YES if @a item matches, otherwise @c NO. 37 | */ 38 | - (BOOL) matches:(id)item describingMismatchTo:(id)mismatchDescription; 39 | 40 | /** 41 | Generates a description of why the matcher has not accepted the item. 42 | 43 | The description will be part of a larger description of why a matching failed, so it should be 44 | concise. 45 | This method assumes that @c matches:item is false, but will not check this. 46 | 47 | @param item The item that the HCMatcher has rejected. 48 | @param mismatchDescription The description to be built or appended to. 49 | */ 50 | - (void) describeMismatchOf:(id)item to:(id)mismatchDescription; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCMatcherAssert.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCMatcherAssert.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | @protocol HCMatcher; 9 | 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void HC_assertThatWithLocation(id testCase, id actual, id matcher, 16 | const char* fileName, int lineNumber); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | /** 23 | OCUnit integration asserting that actual value satisfies matcher. 24 | */ 25 | #define HC_assertThat(actual, matcher) \ 26 | HC_assertThatWithLocation(self, actual, matcher, __FILE__, __LINE__) 27 | 28 | 29 | #ifdef HC_SHORTHAND 30 | 31 | /** 32 | Shorthand for HC_assertThat, available if HC_SHORTHAND is defined. 33 | */ 34 | #define assertThat HC_assertThat 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCNumberAssert.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCNumberAssert.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | #import 9 | 10 | @protocol HCMatcher; 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void HC_assertThatBoolWithLocation(id testCase, BOOL actual, 18 | id matcher, const char* fileName, int lineNumber); 19 | 20 | void HC_assertThatCharWithLocation(id testCase, char actual, 21 | id matcher, const char* fileName, int lineNumber); 22 | 23 | void HC_assertThatDoubleWithLocation(id testCase, double actual, 24 | id matcher, const char* fileName, int lineNumber); 25 | 26 | void HC_assertThatFloatWithLocation(id testCase, float actual, 27 | id matcher, const char* fileName, int lineNumber); 28 | 29 | void HC_assertThatIntWithLocation(id testCase, int actual, 30 | id matcher, const char* fileName, int lineNumber); 31 | 32 | void HC_assertThatLongWithLocation(id testCase, long actual, 33 | id matcher, const char* fileName, int lineNumber); 34 | 35 | void HC_assertThatLongLongWithLocation(id testCase, long long actual, 36 | id matcher, const char* fileName, int lineNumber); 37 | 38 | void HC_assertThatShortWithLocation(id testCase, short actual, 39 | id matcher, const char* fileName, int lineNumber); 40 | 41 | void HC_assertThatUnsignedCharWithLocation(id testCase, unsigned char actual, 42 | id matcher, const char* fileName, int lineNumber); 43 | 44 | void HC_assertThatUnsignedIntWithLocation(id testCase, unsigned int actual, 45 | id matcher, const char* fileName, int lineNumber); 46 | 47 | void HC_assertThatUnsignedLongWithLocation(id testCase, unsigned long actual, 48 | id matcher, const char* fileName, int lineNumber); 49 | 50 | void HC_assertThatUnsignedLongLongWithLocation(id testCase, unsigned long long actual, 51 | id matcher, const char* fileName, int lineNumber); 52 | 53 | void HC_assertThatUnsignedShortWithLocation(id testCase, unsigned short actual, 54 | id matcher, const char* fileName, int lineNumber); 55 | 56 | #if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2 57 | 58 | void HC_assertThatIntegerWithLocation(id testCase, NSInteger actual, 59 | id matcher, const char* fileName, int lineNumber); 60 | 61 | void HC_assertThatUnsignedIntegerWithLocation(id testCase, NSUInteger actual, 62 | id matcher, const char* fileName, int lineNumber); 63 | 64 | #endif // Objective-C 2.0 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | /** 71 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 72 | */ 73 | #define HC_assertThatBool(actual, matcher) \ 74 | HC_assertThatBoolWithLocation(self, actual, matcher, __FILE__, __LINE__) 75 | 76 | /** 77 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 78 | */ 79 | #define HC_assertThatChar(actual, matcher) \ 80 | HC_assertThatCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 81 | 82 | /** 83 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 84 | */ 85 | #define HC_assertThatDouble(actual, matcher) \ 86 | HC_assertThatDoubleWithLocation(self, actual, matcher, __FILE__, __LINE__) 87 | 88 | /** 89 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 90 | */ 91 | #define HC_assertThatFloat(actual, matcher) \ 92 | HC_assertThatFloatWithLocation(self, actual, matcher, __FILE__, __LINE__) 93 | 94 | /** 95 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 96 | */ 97 | #define HC_assertThatInt(actual, matcher) \ 98 | HC_assertThatIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 99 | 100 | /** 101 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 102 | */ 103 | #define HC_assertThatLong(actual, matcher) \ 104 | HC_assertThatLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 105 | 106 | /** 107 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 108 | */ 109 | #define HC_assertThatLongLong(actual, matcher) \ 110 | HC_assertThatLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 111 | 112 | /** 113 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 114 | */ 115 | #define HC_assertThatShort(actual, matcher) \ 116 | HC_assertThatShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 117 | 118 | /** 119 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 120 | */ 121 | #define HC_assertThatUnsignedChar(actual, matcher) \ 122 | HC_assertThatUnsignedCharWithLocation(self, actual, matcher, __FILE__, __LINE__) 123 | 124 | /** 125 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 126 | */ 127 | #define HC_assertThatUnsignedInt(actual, matcher) \ 128 | HC_assertThatUnsignedIntWithLocation(self, actual, matcher, __FILE__, __LINE__) 129 | 130 | /** 131 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 132 | */ 133 | #define HC_assertThatUnsignedLong(actual, matcher) \ 134 | HC_assertThatUnsignedLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 135 | 136 | /** 137 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 138 | */ 139 | #define HC_assertThatUnsignedLongLong(actual, matcher) \ 140 | HC_assertThatUnsignedLongLongWithLocation(self, actual, matcher, __FILE__, __LINE__) 141 | 142 | /** 143 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 144 | */ 145 | #define HC_assertThatUnsignedShort(actual, matcher) \ 146 | HC_assertThatUnsignedShortWithLocation(self, actual, matcher, __FILE__, __LINE__) 147 | 148 | 149 | #if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2 150 | 151 | /** 152 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 153 | */ 154 | #define HC_assertThatInteger(actual, matcher) \ 155 | HC_assertThatIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 156 | 157 | /** 158 | OCUnit integration asserting that actual value, when converted to an NSNumber satisfies matcher. 159 | */ 160 | #define HC_assertThatUnsignedInteger(actual, matcher) \ 161 | HC_assertThatUnsignedIntegerWithLocation(self, actual, matcher, __FILE__, __LINE__) 162 | 163 | #endif // Objective-C 2.0 164 | 165 | 166 | #ifdef HC_SHORTHAND 167 | 168 | /** 169 | Shorthand for HC_assertThatBool, available if HC_SHORTHAND is defined. 170 | */ 171 | #define assertThatBool HC_assertThatBool 172 | 173 | /** 174 | Shorthand for HC_assertThatChar, available if HC_SHORTHAND is defined. 175 | */ 176 | #define assertThatChar HC_assertThatChar 177 | 178 | /** 179 | Shorthand for HC_assertThatDouble, available if HC_SHORTHAND is defined. 180 | */ 181 | #define assertThatDouble HC_assertThatDouble 182 | 183 | /** 184 | Shorthand for HC_assertThatFloat, available if HC_SHORTHAND is defined. 185 | */ 186 | #define assertThatFloat HC_assertThatFloat 187 | 188 | /** 189 | Shorthand for HC_assertThatInt, available if HC_SHORTHAND is defined. 190 | */ 191 | #define assertThatInt HC_assertThatInt 192 | 193 | /** 194 | Shorthand for HC_assertThatLong, available if HC_SHORTHAND is defined. 195 | */ 196 | #define assertThatLong HC_assertThatLong 197 | 198 | /** 199 | Shorthand for HC_assertThatLongLong, available if HC_SHORTHAND is defined. 200 | */ 201 | #define assertThatLongLong HC_assertThatLongLong 202 | 203 | /** 204 | Shorthand for HC_assertThatShort, available if HC_SHORTHAND is defined. 205 | */ 206 | #define assertThatShort HC_assertThatShort 207 | 208 | /** 209 | Shorthand for HC_assertThatUnsignedChar, available if HC_SHORTHAND is defined. 210 | */ 211 | #define assertThatUnsignedChar HC_assertThatUnsignedChar 212 | 213 | /** 214 | Shorthand for HC_assertThatUnsignedInt, available if HC_SHORTHAND is defined. 215 | */ 216 | #define assertThatUnsignedInt HC_assertThatUnsignedInt 217 | 218 | /** 219 | Shorthand for HC_assertThatUnsignedLong, available if HC_SHORTHAND is defined. 220 | */ 221 | #define assertThatUnsignedLong HC_assertThatUnsignedLong 222 | 223 | /** 224 | Shorthand for HC_assertThatUnsignedLongLong, available if HC_SHORTHAND is defined. 225 | */ 226 | #define assertThatUnsignedLongLong HC_assertThatUnsignedLongLong 227 | 228 | /** 229 | Shorthand for HC_assertThatInt, available if HC_SHORTHAND is defined. 230 | */ 231 | #define assertThatUnsignedShort HC_assertThatUnsignedShort 232 | 233 | 234 | #if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2 235 | 236 | /** 237 | Shorthand for HC_assertThatInt, available if HC_SHORTHAND is defined. 238 | */ 239 | #define assertThatInteger HC_assertThatInteger 240 | 241 | /** 242 | Shorthand for HC_assertThatInt, available if HC_SHORTHAND is defined. 243 | */ 244 | #define assertThatUnsignedInteger HC_assertThatUnsignedInteger 245 | 246 | #endif // Objective-C 2.0 247 | 248 | #endif // HC_SHORTHAND 249 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCOrderingComparison.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCOrderingComparison.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCOrderingComparison : HCBaseMatcher 13 | { 14 | id value; 15 | NSComparisonResult minCompare; 16 | NSComparisonResult maxCompare; 17 | } 18 | 19 | + (HCOrderingComparison*) compare:(id)aValue 20 | minCompare:(NSComparisonResult)min 21 | maxCompare:(NSComparisonResult)max; 22 | - (id) initComparing:(id)aValue 23 | minCompare:(NSComparisonResult)min 24 | maxCompare:(NSComparisonResult)max; 25 | 26 | @end 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /** 34 | Is value > expected? 35 | */ 36 | id HC_greaterThan(id aValue); 37 | 38 | /** 39 | Is value >= expected? 40 | */ 41 | id HC_greaterThanOrEqualTo(id aValue); 42 | 43 | /** 44 | Is value < expected? 45 | */ 46 | id HC_lessThan(id aValue); 47 | 48 | /** 49 | Is value <= expected? 50 | */ 51 | id HC_lessThanOrEqualTo(id aValue); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | 58 | #ifdef HC_SHORTHAND 59 | 60 | /** 61 | Shorthand for HC_greaterThan, available if HC_SHORTHAND is defined. 62 | */ 63 | #define greaterThan HC_greaterThan 64 | 65 | /** 66 | Shorthand for HC_greaterThan, available if HC_SHORTHAND is defined. 67 | */ 68 | #define greaterThanOrEqualTo HC_greaterThanOrEqualTo 69 | 70 | /** 71 | Shorthand for HC_greaterThan, available if HC_SHORTHAND is defined. 72 | */ 73 | #define lessThan HC_lessThan 74 | 75 | /** 76 | Shorthand for HC_lessThanOrEqualTo, available if HC_SHORTHAND is defined. 77 | */ 78 | #define lessThanOrEqualTo HC_lessThanOrEqualTo 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCRequireNonNilString.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCRequireNonNilString.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Mac 9 | #import 10 | 11 | 12 | namespace hamcrest { 13 | 14 | /** 15 | Throws an NSException if @a string is nil. 16 | */ 17 | inline 18 | void requireNonNilString(NSString* string) 19 | { 20 | if (string == nil) 21 | { 22 | @throw [NSException exceptionWithName: @"NotAString" 23 | reason: @"Must be non-nil string" 24 | userInfo: nil]; 25 | } 26 | } 27 | 28 | } // namespace hamcrest 29 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCSelfDescribing.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSelfDescribing.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import 10 | 11 | @protocol HCDescription; 12 | 13 | 14 | /** 15 | The ability of an object to describe itself. 16 | */ 17 | @protocol HCSelfDescribing 18 | 19 | /** 20 | Generates a description of the object. 21 | 22 | The description may be part of a description of a larger object of which this is just a 23 | component, so it should be worded appropriately. 24 | 25 | @param description The description to be built or appended to. 26 | */ 27 | - (void) describeTo:(id)description; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCStringContains.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringContains.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCSubstringMatcher.h" 10 | 11 | 12 | /** 13 | Tests if the argument is a string that contains a substring. 14 | */ 15 | @interface HCStringContains : HCSubstringMatcher 16 | { 17 | } 18 | 19 | + (HCStringContains*) stringContains:(NSString*)aSubstring; 20 | 21 | @end 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | id HC_containsString(NSString* aSubstring); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #ifdef HC_SHORTHAND 36 | 37 | /** 38 | Shorthand for HC_containsString, available if HC_SHORTHAND is defined. 39 | */ 40 | #define containsString HC_containsString 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCStringDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringDescription.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseDescription.h" 10 | 11 | @protocol HCSelfDescribing; 12 | 13 | 14 | /** 15 | An HCDescription that is stored as a string. 16 | */ 17 | @interface HCStringDescription : HCBaseDescription 18 | { 19 | NSMutableString* accumulator; 20 | } 21 | 22 | /** 23 | Returns the description of an HCSelfDescribing object as a string. 24 | 25 | @param selfDescribing The object to be described. 26 | @return The description of the object. 27 | */ 28 | + (NSString*) stringFrom:(id)selfDescribing; 29 | 30 | /** 31 | Returns an empty description. 32 | */ 33 | + (HCStringDescription*) stringDescription; 34 | 35 | /** 36 | Returns an initialized HCStringDescription object that is empty. 37 | */ 38 | - (id) init; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCStringEndsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringEndsWith.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCSubstringMatcher.h" 10 | 11 | 12 | /** 13 | Tests if the argument is a string that ends with a substring. 14 | */ 15 | @interface HCStringEndsWith : HCSubstringMatcher 16 | { 17 | } 18 | 19 | + (HCStringEndsWith*) stringEndsWith:(NSString*)aSubstring; 20 | 21 | @end 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | id HC_endsWith(NSString* aSubstring); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #ifdef HC_SHORTHAND 36 | 37 | /** 38 | Shorthand for HC_endsWith, available if HC_SHORTHAND is defined. 39 | */ 40 | #define endsWith HC_endsWith 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCStringStartsWith.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCStringStartsWith.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCSubstringMatcher.h" 10 | 11 | 12 | /** 13 | Tests if the argument is a string that starts with a substring. 14 | */ 15 | @interface HCStringStartsWith : HCSubstringMatcher 16 | { 17 | } 18 | 19 | + (HCStringStartsWith*) stringStartsWith:(NSString*)aSubstring; 20 | 21 | @end 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | id HC_startsWith(NSString* aSubstring); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #ifdef HC_SHORTHAND 36 | 37 | /** 38 | Shorthand for HC_startsWith, available if HC_SHORTHAND is defined. 39 | */ 40 | #define startsWith HC_startsWith 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCSubstringMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCSubstringMatcher.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Inherited 9 | #import "HCBaseMatcher.h" 10 | 11 | 12 | @interface HCSubstringMatcher : HCBaseMatcher 13 | { 14 | NSString* substring; 15 | } 16 | 17 | - (id) initWithSubstring:(NSString*)aSubstring; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/HCWrapInMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - HCWrapInMatcher.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | @protocol HCMatcher; 9 | 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /** 16 | Returns @a item wrapped (if necessary) in an HCIsEqual matcher. 17 | 18 | @a item is returned as-is if it is already an HCMatcher. 19 | */ 20 | id HC_wrapInMatcher(id item); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Headers/OCHamcrest.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCHamcrest - OCHamcrest.h 3 | // Copyright 2009 www.hamcrest.org. See LICENSE.txt 4 | // 5 | // Created by: Jon Reid 6 | // 7 | 8 | // Unit test integration 9 | #import "HCMatcherAssert.h" 10 | #import "HCNumberAssert.h" 11 | 12 | // Core 13 | #import "HCAllOf.h" 14 | #import "HCAnyOf.h" 15 | #import "HCDescribedAs.h" 16 | #import "HCIs.h" 17 | #import "HCIsAnything.h" 18 | #import "HCIsEqual.h" 19 | #import "HCIsInstanceOf.h" 20 | #import "HCIsNil.h" 21 | #import "HCIsNot.h" 22 | #import "HCIsSame.h" 23 | 24 | // Library: Collection 25 | #import "HCIsCollectionContaining.h" 26 | #import "HCIsCollectionOnlyContaining.h" 27 | #import "HCIsDictionaryContaining.h" 28 | #import "HCIsDictionaryContainingKey.h" 29 | #import "HCIsDictionaryContainingValue.h" 30 | #import "HCIsIn.h" 31 | 32 | // Library: Number 33 | #import "HCIsCloseTo.h" 34 | #import "HCIsEqualToNumber.h" 35 | #import "HCOrderingComparison.h" 36 | 37 | // Library: Object 38 | #import "HCHasDescription.h" 39 | 40 | // Library: Text 41 | #import "HCIsEqualIgnoringCase.h" 42 | #import "HCIsEqualIgnoringWhiteSpace.h" 43 | #import "HCStringContains.h" 44 | #import "HCStringEndsWith.h" 45 | #import "HCStringStartsWith.h" 46 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/OCHamcrest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petejkim/ConciseKit/4a70ea47856c3b0698f8330f19a557295068940e/ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/OCHamcrest -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | OCHamcrest 9 | CFBundleIdentifier 10 | org.hamcrest 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | OCHamcrest 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | hamc 19 | CFBundleVersion 20 | 1.0 21 | 22 | 23 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Resources/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petejkim/ConciseKit/4a70ea47856c3b0698f8330f19a557295068940e/ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/A/Resources/InfoPlist.strings -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCHamcrest.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/OCMock: -------------------------------------------------------------------------------- 1 | Versions/Current/OCMock -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: NSNotificationCenter+OCMAdditions.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @class OCMockObserver; 9 | 10 | 11 | @interface NSNotificationCenter(OCMAdditions) 12 | 13 | - (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMArg.h 65 2010-07-28 01:49:42Z erik $ 3 | // Copyright (c) 2009-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMArg : NSObject 9 | 10 | // constraining arguments 11 | 12 | + (id)any; 13 | + (void *)anyPointer; 14 | + (id)isNil; 15 | + (id)isNotNil; 16 | + (id)isNotEqual:(id)value; 17 | + (id)checkWithSelector:(SEL)selector onObject:(id)anObject; 18 | #if NS_BLOCKS_AVAILABLE 19 | + (id)checkWithBlock:(BOOL (^)(id))block; 20 | #endif 21 | 22 | // manipulating arguments 23 | 24 | + (id *)setTo:(id)value; 25 | 26 | // internal use only 27 | 28 | + (id)resolveSpecialValues:(NSValue *)value; 29 | 30 | @end 31 | 32 | #define OCMOCK_ANY [OCMArg any] 33 | #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] 34 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMConstraint.h 57 2010-07-19 06:14:27Z erik $ 3 | // Copyright (c) 2007-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | 9 | @interface OCMConstraint : NSObject 10 | 11 | + (id)constraint; 12 | - (BOOL)evaluate:(id)value; 13 | 14 | // if you are looking for any, isNil, etc, they have moved to OCMArg 15 | 16 | // try to use [OCMArg checkWith...] instead of the constraintWith... methods below 17 | 18 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; 19 | + (id)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; 20 | 21 | 22 | @end 23 | 24 | @interface OCMAnyConstraint : OCMConstraint 25 | @end 26 | 27 | @interface OCMIsNilConstraint : OCMConstraint 28 | @end 29 | 30 | @interface OCMIsNotNilConstraint : OCMConstraint 31 | @end 32 | 33 | @interface OCMIsNotEqualConstraint : OCMConstraint 34 | { 35 | @public 36 | id testValue; 37 | } 38 | 39 | @end 40 | 41 | @interface OCMInvocationConstraint : OCMConstraint 42 | { 43 | @public 44 | NSInvocation *invocation; 45 | } 46 | 47 | @end 48 | 49 | #if NS_BLOCKS_AVAILABLE 50 | 51 | @interface OCMBlockConstraint : OCMConstraint 52 | { 53 | BOOL (^block)(id); 54 | } 55 | 56 | - (id)initWithConstraintBlock:(BOOL (^)(id))block; 57 | 58 | @end 59 | 60 | #endif 61 | 62 | 63 | #define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] 64 | #define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] 65 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id$ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import "OCMockObject.h" 7 | #import "OCMockRecorder.h" 8 | #import "OCMConstraint.h" 9 | #import "OCMArg.h" 10 | #import "NSNotificationCenter+OCMAdditions.h" 11 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockObject.h 69 2010-08-20 16:05:58Z erik $ 3 | // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockObject : NSProxy 9 | { 10 | BOOL isNice; 11 | BOOL expectationOrderMatters; 12 | NSMutableArray *recorders; 13 | NSMutableArray *expectations; 14 | NSMutableArray *rejections; 15 | NSMutableArray *exceptions; 16 | } 17 | 18 | + (id)mockForClass:(Class)aClass; 19 | + (id)mockForProtocol:(Protocol *)aProtocol; 20 | + (id)partialMockForObject:(NSObject *)anObject; 21 | 22 | + (id)niceMockForClass:(Class)aClass; 23 | + (id)niceMockForProtocol:(Protocol *)aProtocol; 24 | 25 | + (id)observerMock; 26 | 27 | - (id)init; 28 | 29 | - (void)setExpectationOrderMatters:(BOOL)flag; 30 | 31 | - (id)stub; 32 | - (id)expect; 33 | - (id)reject; 34 | 35 | - (void)verify; 36 | 37 | // internal use only 38 | 39 | - (id)getNewRecorder; 40 | - (BOOL)handleInvocation:(NSInvocation *)anInvocation; 41 | - (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Headers/OCMockRecorder.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // $Id: OCMockRecorder.h 68 2010-08-20 13:20:52Z erik $ 3 | // Copyright (c) 2004-2010 by Mulle Kybernetik. See License file for details. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | #import 7 | 8 | @interface OCMockRecorder : NSProxy 9 | { 10 | id signatureResolver; 11 | NSInvocation *recordedInvocation; 12 | NSMutableArray *invocationHandlers; 13 | } 14 | 15 | - (id)initWithSignatureResolver:(id)anObject; 16 | 17 | - (BOOL)matchesInvocation:(NSInvocation *)anInvocation; 18 | - (void)releaseInvocation; 19 | 20 | - (id)andReturn:(id)anObject; 21 | - (id)andReturnValue:(NSValue *)aValue; 22 | - (id)andThrow:(NSException *)anException; 23 | - (id)andPost:(NSNotification *)aNotification; 24 | - (id)andCall:(SEL)selector onObject:(id)anObject; 25 | #if NS_BLOCKS_AVAILABLE 26 | - (id)andDo:(void (^)(NSInvocation *))block; 27 | #endif 28 | - (id)andForwardToRealObject; 29 | 30 | - (NSArray *)invocationHandlers; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/OCMock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petejkim/ConciseKit/4a70ea47856c3b0698f8330f19a557295068940e/ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/OCMock -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | OCMock 9 | CFBundleIdentifier 10 | com.mulle-kybernetik.OCMock 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | OCMock 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.29 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | NSHumanReadableCopyright 24 | Copyright © 2004-2009 Mulle Kybernetik. 25 | 26 | 27 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/A/Resources/License.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2004-2010 by Mulle Kybernetik. All rights reserved. 3 | 4 | Permission to use, copy, modify and distribute this software and its documentation 5 | is hereby granted, provided that both the copyright notice and this permission 6 | notice appear in all copies of the software, derivative works or modified versions, 7 | and any portions thereof, and that both notices appear in supporting documentation, 8 | and that credit is given to Mulle Kybernetik in all documents and publicity 9 | pertaining to direct or indirect use of this code or its derivatives. 10 | 11 | THIS IS EXPERIMENTAL SOFTWARE AND IT IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE 12 | SERIOUS CONSEQUENCES. THE COPYRIGHT HOLDER ALLOWS FREE USE OF THIS SOFTWARE IN ITS 13 | "AS IS" CONDITION. THE COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY 14 | DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE 15 | OR OF ANY DERIVATIVE WORK. -------------------------------------------------------------------------------- /ConciseKitSpecs/Frameworks/OCMock.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/ConciseKitSpec.m: -------------------------------------------------------------------------------- 1 | #import "SpecHelper.h" 2 | #import "ConciseKit.h" 3 | #import "Foo.h" 4 | #import "CKMocks.h" 5 | 6 | #if __has_feature(objc_arc) 7 | #define ARCLESS(block) 8 | #else 9 | #define ARCLESS(block) block 10 | #endif 11 | 12 | DESCRIBE($) { 13 | describe(@"path", ^{ 14 | describe(@"+homePath", ^{ 15 | it(@"returns the user's home directory", ^{ 16 | assertThat([$ homePath], equalTo([@"~" stringByExpandingTildeInPath])); 17 | }); 18 | }); 19 | 20 | describe(@"+desktopPath", ^{ 21 | it(@"returns the user's desktop directory", ^{ 22 | assertThat([$ desktopPath], equalTo([@"~/Desktop" stringByExpandingTildeInPath])); 23 | }); 24 | }); 25 | 26 | describe(@"+documentPath", ^{ 27 | it(@"returns the user's document directory", ^{ 28 | assertThat([$ documentPath], equalTo([@"~/Documents" stringByExpandingTildeInPath])); 29 | }); 30 | }); 31 | 32 | describe(@"+appPath", ^{ 33 | it(@"returns the app's directory", ^{ 34 | assertThat([$ appPath], endsWith(@"ConciseKitSpecs.app")); 35 | }); 36 | }); 37 | 38 | describe(@"+resourcePath", ^{ 39 | it(@"returns the app's directory", ^{ 40 | assertThat([$ resourcePath], endsWith(@"ConciseKitSpecs.app/Contents/Resources")); 41 | }); 42 | }); 43 | }); 44 | 45 | describe(@"method swizzling", ^{ 46 | describe(@"+swizzleMethod:with:in:", ^{ 47 | it(@"swizzles instance methods", ^{ 48 | Foo *foo = [[Foo alloc] init]; 49 | assertThat([foo foo], equalTo(@"-foo")); 50 | assertThat([foo bar], equalTo(@"-bar")); 51 | [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[Foo class]]; 52 | assertThat([foo foo], equalTo(@"-bar")); 53 | assertThat([foo bar], equalTo(@"-foo")); 54 | [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[Foo class]]; 55 | assertThat([foo foo], equalTo(@"-foo")); 56 | assertThat([foo bar], equalTo(@"-bar")); 57 | ARCLESS([foo release]); 58 | }); 59 | 60 | context(@"swizzling inherited methods", ^{ 61 | it(@"adds the inherited methods to the subclass and then swizzles, preserving the original method in superclass", ^{ 62 | Foo *foo = [[Foo alloc] init]; 63 | SubFoo *subFoo = [[SubFoo alloc] init]; 64 | assertThat([foo foo], equalTo(@"-foo")); 65 | assertThat([subFoo foo], equalTo(@"-foo")); 66 | assertThat([subFoo bar], equalTo(@"-SubFoo::bar")); 67 | [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[SubFoo class]]; 68 | assertThat([foo foo], equalTo(@"-foo")); 69 | assertThat([subFoo foo], equalTo(@"-SubFoo::bar")); 70 | assertThat([subFoo bar], equalTo(@"-foo")); 71 | [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[SubFoo class]]; 72 | assertThat([foo foo], equalTo(@"-foo")); 73 | assertThat([subFoo foo], equalTo(@"-foo")); 74 | assertThat([subFoo bar], equalTo(@"-SubFoo::bar")); 75 | ARCLESS([foo release]); 76 | ARCLESS([subFoo release]); 77 | }); 78 | }); 79 | }); 80 | 81 | describe(@"+swizzleMethod:in:with:in:", ^{ 82 | it(@"swizzles instance methods", ^{ 83 | Foo *foo = [[Foo alloc] init]; 84 | Bar *bar = [[Bar alloc] init]; 85 | assertThat([foo foo], equalTo(@"-foo")); 86 | assertThat([bar bar], equalTo(@"-Bar::bar")); 87 | [$ swizzleMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]; 88 | assertThat([foo foo], equalTo(@"-Bar::bar")); 89 | assertThat([bar bar], equalTo(@"-foo")); 90 | [$ swizzleMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]; 91 | assertThat([foo foo], equalTo(@"-foo")); 92 | assertThat([bar bar], equalTo(@"-Bar::bar")); 93 | ARCLESS([foo release]); 94 | ARCLESS([bar release]); 95 | }); 96 | }); 97 | 98 | describe(@"+swizzleClassMethod:with:in:", ^{ 99 | it(@"swizzles class methods", ^{ 100 | assertThat([Foo foo], equalTo(@"+foo")); 101 | assertThat([Foo bar], equalTo(@"+bar")); 102 | [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[Foo class]]; 103 | assertThat([Foo foo], equalTo(@"+bar")); 104 | assertThat([Foo bar], equalTo(@"+foo")); 105 | [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[Foo class]]; 106 | assertThat([Foo foo], equalTo(@"+foo")); 107 | assertThat([Foo bar], equalTo(@"+bar")); 108 | }); 109 | 110 | context(@"swizzling inherited class methods", ^{ 111 | it(@"adds the inherited class methods to the subclass and then swizzles, preserving the original method in superclass", ^{ 112 | assertThat([Foo foo], equalTo(@"+foo")); 113 | assertThat([SubFoo foo], equalTo(@"+foo")); 114 | assertThat([SubFoo bar], equalTo(@"+SubFoo::bar")); 115 | [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[SubFoo class]]; 116 | assertThat([Foo foo], equalTo(@"+foo")); 117 | assertThat([SubFoo foo], equalTo(@"+SubFoo::bar")); 118 | assertThat([SubFoo bar], equalTo(@"+foo")); 119 | [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[SubFoo class]]; 120 | assertThat([Foo foo], equalTo(@"+foo")); 121 | assertThat([SubFoo foo], equalTo(@"+foo")); 122 | assertThat([SubFoo bar], equalTo(@"+SubFoo::bar")); 123 | }); 124 | }); 125 | }); 126 | 127 | describe(@"+swizzleClassMethod:in:with:in:", ^{ 128 | it(@"swizzles class methods", ^{ 129 | assertThat([Foo foo], equalTo(@"+foo")); 130 | assertThat([Bar bar], equalTo(@"+Bar::bar")); 131 | [$ swizzleClassMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]; 132 | assertThat([Foo foo], equalTo(@"+Bar::bar")); 133 | assertThat([Bar bar], equalTo(@"+foo")); 134 | [$ swizzleClassMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]; 135 | assertThat([Foo foo], equalTo(@"+foo")); 136 | assertThat([Bar bar], equalTo(@"+Bar::bar")); 137 | }); 138 | }); 139 | }); 140 | 141 | describe(@"waitUntil", ^{ 142 | __block BOOL (^condition)(void); 143 | 144 | beforeEach(^{ 145 | [CKMocks resetAll]; 146 | condition = ^{ 147 | return YES; 148 | }; 149 | }); 150 | 151 | describe(@"+waitUntil:timeOut:interval:", ^{ 152 | it(@"waits until condition is met", ^{ 153 | __block BOOL performed = NO; 154 | [[NSOperationQueue mainQueue] addOperationWithBlock:^{ 155 | performed = YES; 156 | }]; 157 | assertThatBool(performed, equalToBool(NO)); 158 | [$ waitUntil:^{ return (BOOL)(performed == YES); } timeOut:10.0 interval:0.1]; 159 | assertThatBool(performed, equalToBool(YES)); 160 | }); 161 | }); 162 | 163 | describe(@"+waitUntil:timeOut:", ^{ 164 | it(@"calls +waitUntil:timeOut:interval: with interval=0.1", ^{ 165 | [$ swizzleClassMethod:@selector(waitUntil:timeOut:interval:) in:[$ class] with:@selector(waitUntil:timeOut:interval:) in:[CKMocks class]]; 166 | [$ waitUntil:condition timeOut:20.0]; 167 | NSArray *array = [CKMocks callsForSelector:@selector(waitUntil:timeOut:interval:) in:[$ class]]; 168 | assertThatUnsignedInteger([array count], equalToUnsignedInteger(1)); 169 | assertThat([array $at:0], equalTo($arr(condition, $double(20.0), $double(0.1)))); 170 | [$ swizzleClassMethod:@selector(waitUntil:timeOut:interval:) in:[$ class] with:@selector(waitUntil:timeOut:interval:) in:[CKMocks class]]; 171 | }); 172 | }); 173 | 174 | describe(@"+waitUntil:", ^{ 175 | it(@"calls +waitUntil:timeOut:interval: with timeOut=10.0, interval=0.1", ^{ 176 | [$ swizzleClassMethod:@selector(waitUntil:timeOut:interval:) in:[$ class] with:@selector(waitUntil:timeOut:interval:) in:[CKMocks class]]; 177 | [$ waitUntil:condition]; 178 | NSArray *array = [CKMocks callsForSelector:@selector(waitUntil:timeOut:interval:) in:[$ class]]; 179 | assertThatUnsignedInteger([array count], equalToUnsignedInteger(1)); 180 | assertThat([array $at:0], equalTo($arr(condition, $double(10.0), $double(0.1)))); 181 | [$ swizzleClassMethod:@selector(waitUntil:timeOut:interval:) in:[$ class] with:@selector(waitUntil:timeOut:interval:) in:[CKMocks class]]; 182 | }); 183 | }); 184 | }); 185 | 186 | describe(@"$safe", ^{ 187 | NSNull *n = [NSNull null]; 188 | assertThat($safe(n), nilValue()); 189 | NSString *foo = @"foo"; 190 | assertThat($safe(foo), equalTo(@"foo")); 191 | }); 192 | } 193 | DESCRIBE_END -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Fixtures/CKMocks.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CKMocks : NSObject {} 4 | 5 | + (void)resetAll; 6 | + (void)resetForSelector:(SEL)selector in:(Class)klass; 7 | + (NSArray *)callsForSelector:(SEL)selector in:(Class)klass; 8 | + (NSUInteger)callCountForSelector:(SEL)selector in:(Class)klass; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Fixtures/CKMocks.m: -------------------------------------------------------------------------------- 1 | #import "CKMocks.h" 2 | #import "ConciseKit.h" 3 | 4 | static NSMutableDictionary *dict; 5 | 6 | @interface CKMocks (PrivateMethods) 7 | 8 | + (NSString *)keyForSelector:(SEL)selector in:(Class)klass; 9 | + (void)addReceivedValues:(NSArray *)values forSelector:(SEL)selector in:(Class)klass; 10 | 11 | @end 12 | 13 | @implementation CKMocks 14 | 15 | + (void)initialize { 16 | dict = [[NSMutableDictionary alloc] init]; 17 | } 18 | 19 | + (NSString *)keyForSelector:(SEL)selector in:(Class)klass { 20 | return $str(@"[%@ %@]", NSStringFromClass(klass), NSStringFromSelector(selector)); 21 | } 22 | 23 | + (void)addReceivedValues:(NSArray *)values forSelector:(SEL)selector in:(Class)klass { 24 | NSString *key = [self keyForSelector:selector in:klass]; 25 | if([dict objectForKey:key] == nil) { 26 | [dict setObject:$marr(nil) forKey:key]; 27 | } 28 | [(NSMutableArray *)[dict objectForKey:key] $push:values]; 29 | } 30 | 31 | + (void)resetAll { 32 | [dict removeAllObjects]; 33 | } 34 | 35 | + (void)resetForSelector:(SEL)selector in:(Class)klass { 36 | [dict removeObjectForKey:[self keyForSelector:selector in:klass]]; 37 | } 38 | 39 | + (NSArray *)callsForSelector:(SEL)selector in:(Class)klass { 40 | NSArray *values = [dict objectForKey:[self keyForSelector:selector in:klass]]; 41 | if(values == nil) { 42 | return $arr(nil); 43 | } 44 | return values; 45 | } 46 | 47 | + (NSUInteger)callCountForSelector:(SEL)selector in:(Class)klass { 48 | NSArray *values = [dict objectForKey:[self keyForSelector:selector in:klass]]; 49 | if(values == nil) { 50 | return 0; 51 | } 52 | return [values count]; 53 | } 54 | 55 | @end 56 | 57 | @interface CKMocks (MockMethods) 58 | // ConciseKit 59 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval; 60 | @end 61 | 62 | @implementation CKMocks (MockMethods) 63 | // ConciseKit 64 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval { 65 | [CKMocks addReceivedValues:$arr(condition, $double(timeOut), $double(interval)) forSelector:@selector(waitUntil:timeOut:interval:) in:[$ class]]; 66 | } 67 | @end -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Fixtures/Foo.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Foo : NSObject {} 4 | + (NSString *)foo; 5 | + (NSString *)bar; 6 | - (NSString *)foo; 7 | - (NSString *)bar; 8 | @end 9 | 10 | @interface SubFoo : Foo {} 11 | @end 12 | 13 | @interface Bar : NSObject {} 14 | + (NSString *)bar; 15 | - (NSString *)bar; 16 | @end -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Fixtures/Foo.m: -------------------------------------------------------------------------------- 1 | #import "Foo.h" 2 | 3 | @implementation Foo 4 | + (NSString *)foo { return @"+foo"; } 5 | + (NSString *)bar { return @"+bar"; } 6 | - (NSString *)foo { return @"-foo"; } 7 | - (NSString *)bar { return @"-bar"; } 8 | @end 9 | 10 | @implementation SubFoo 11 | + (NSString *)bar { return @"+SubFoo::bar"; } 12 | - (NSString *)bar { return @"-SubFoo::bar"; } 13 | @end 14 | 15 | @implementation Bar 16 | + (NSString *)bar { return @"+Bar::bar"; } 17 | - (NSString *)bar { return @"-Bar::bar"; } 18 | @end -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/NSArrayConciseKitSpec.m: -------------------------------------------------------------------------------- 1 | #import "SpecHelper.h" 2 | #import "ConciseKit.h" 3 | 4 | DESCRIBE(NSArrayConciseKit) { 5 | describe(@"NSArray (ConciseKit)", ^{ 6 | __block NSArray *array; 7 | 8 | beforeEach(^{ 9 | array = [NSArray arrayWithObjects:@"foo", @"bar", @"baz", nil]; 10 | }); 11 | 12 | describe(@"$arr", ^{ 13 | it(@"creates an array", ^{ 14 | assertThat($arr(@"foo", @"bar", @"baz"), equalTo(array)); 15 | }); 16 | }); 17 | 18 | describe(@"-$first", ^{ 19 | it(@"returns the first object", ^{ 20 | assertThat([array $first], equalTo(@"foo")); 21 | }); 22 | }); 23 | 24 | describe(@"-$last", ^{ 25 | it(@"returns the first object", ^{ 26 | assertThat([array $last], equalTo(@"baz")); 27 | }); 28 | }); 29 | 30 | describe(@"-$at:", ^{ 31 | it(@"returns the object at the given index", ^{ 32 | assertThat([array $at:1], equalTo(@"bar")); 33 | }); 34 | }); 35 | 36 | describe(@"-$each:", ^{ 37 | it(@"runs block for each item, passing the item as an argument", ^{ 38 | __block NSInteger i=0; 39 | [$arr($integer(1), $integer(2), $integer(3)) $each:^(id obj) { 40 | i += [obj integerValue]; 41 | }]; 42 | assertThatInteger(i, equalToInteger(6)); 43 | }); 44 | }); 45 | 46 | describe(@"-$eachWithIndex:", ^{ 47 | it(@"runs block for each item, passing the item and its index as arguments", ^{ 48 | __block NSInteger i=0; 49 | [$arr($integer(1), $integer(2), $integer(3)) $eachWithIndex:^(id obj, NSUInteger j) { 50 | i += [obj integerValue] + j; 51 | }]; 52 | assertThatInteger(i, equalToInteger(9)); 53 | }); 54 | }); 55 | 56 | describe(@"-$eachWithStop:", ^{ 57 | it(@"runs block for each item, passing the item as an argument, until stop is set to YES", ^{ 58 | __block NSInteger i=0; 59 | [$arr($integer(1), $integer(2), $integer(3)) $eachWithStop:^(id obj, BOOL *stop) { 60 | i += [obj integerValue]; 61 | if([obj integerValue] == 2) { 62 | *stop = YES; 63 | } 64 | }]; 65 | assertThatInteger(i, equalToInteger(3)); 66 | }); 67 | }); 68 | 69 | describe(@"-$eachWithIndexAndStop:", ^{ 70 | it(@"runs block for each item, passing the item and its index as arguments, until stop is set to YES", ^{ 71 | __block NSInteger i=0; 72 | [$arr($integer(1), $integer(2), $integer(3)) $eachWithIndexAndStop:^(id obj, NSUInteger j, BOOL *stop) { 73 | i += [obj integerValue] + j; 74 | if([obj integerValue] == 2) { 75 | *stop = YES; 76 | } 77 | }]; 78 | assertThatInteger(i, equalToInteger(4)); 79 | }); 80 | }); 81 | 82 | describe(@"-$map:", ^{ 83 | it(@"runs block for each item, passing the item as an argument, and creates a new array containing the return values of the block", ^{ 84 | array = [$arr($integer(1), $integer(2), $integer(3)) $map:^(id obj) { 85 | return (id)$integer([obj integerValue] * 2); 86 | }]; 87 | assertThat(array, equalTo($arr($integer(2), $integer(4), $integer(6)))); 88 | }); 89 | }); 90 | 91 | describe(@"-$mapWithIndex:", ^{ 92 | it(@"runs block for each item, passing the item and its index as arguments and creates a new array containing the return values of the block", ^{ 93 | array = [$arr($integer(1), $integer(2), $integer(3)) $mapWithIndex:^(id obj, NSUInteger j) { 94 | return (id)$integer([obj integerValue] * 2 + j); 95 | }]; 96 | assertThat(array, equalTo($arr($integer(2), $integer(5), $integer(8)))); 97 | }); 98 | }); 99 | 100 | describe(@"-$reduce:", ^{ 101 | it(@"runs a block for each item, passing in a memoized value and the item, reassigning the memoized value from the return value of each iteration, finally returning the last return value", ^{ 102 | NSNumber *result = [$arr($integer(1), $integer(2), $integer(3), $integer(4)) $reduce:^(NSNumber *memo, NSNumber *obj) { 103 | return $integer([memo integerValue] + [obj integerValue]); 104 | }]; 105 | assertThat(result, equalTo($integer(10))); 106 | }); 107 | }); 108 | 109 | describe(@"-$reduceStartingAt:with:", ^{ 110 | it(@"performs a reduce function with a starting value", ^{ 111 | NSNumber *result = [$arr($integer(10), $integer(2), $integer(3)) $reduceStartingAt:$integer(1) with:^(NSNumber *memo, NSNumber *obj) { 112 | return $integer([memo integerValue] * [obj integerValue]); 113 | }]; 114 | assertThat(result, equalTo($integer(60))); 115 | }); 116 | }); 117 | 118 | describe(@"-$select:", ^{ 119 | it(@"creates a subarray from elements where the block returns YES", ^{ 120 | array = [$arr($integer(1), $integer(2), $integer(3), $integer(4)) $select:^BOOL(NSNumber *obj) { 121 | return ([obj integerValue] % 2) == 0; 122 | }]; 123 | assertThat(array, equalTo($arr($integer(2), $integer(4)))); 124 | }); 125 | }); 126 | 127 | describe(@"-$detect:", ^{ 128 | it(@"returns the first value for which the block returns YES", ^{ 129 | NSNumber *result = [$arr($integer(1), $integer(2), $integer(3)) $detect:^BOOL(NSNumber *obj) { 130 | return ([obj integerValue] % 2) == 1; 131 | }]; 132 | assertThat(result, equalTo($integer(1))); 133 | }); 134 | }); 135 | 136 | describe(@"-$join", ^{ 137 | it(@"joins the strings in the array without a separator, (more concise than componentsJoinedByString)", ^{ 138 | assertThat([$arr(@"a", @"b", @"c") $join], equalTo(@"abc")); 139 | }); 140 | }); 141 | 142 | describe(@"-$join:", ^{ 143 | it(@"joins the strings in the array with the supplied separator, (more concise than componentsJoinedByString)", ^{ 144 | assertThat([$arr(@"a", @"b", @"c") $join:@"-"], equalTo(@"a-b-c")); 145 | }); 146 | }); 147 | }); 148 | 149 | describe(@"NSMutableArray (ConciseKit)", ^{ 150 | __block NSMutableArray *marray; 151 | 152 | beforeEach(^{ 153 | marray = [NSMutableArray arrayWithObjects:@"foo", @"bar", @"baz", nil]; 154 | }); 155 | 156 | describe(@"$marr", ^{ 157 | it(@"creates a mutable array", ^{ 158 | NSMutableArray *newArray = $marr(@"foo", @"bar", @"baz"); 159 | assertThat(newArray, equalTo(marray)); 160 | [newArray addObject:@"lol"]; 161 | assertThat(newArray, equalTo([NSArray arrayWithObjects:@"foo", @"bar", @"baz", @"lol", nil])); 162 | }); 163 | }); 164 | 165 | describe(@"$marrnew", ^{ 166 | it(@"creates an empty mutable array", ^{ 167 | NSMutableArray *newArray = $marrnew; 168 | assertThatInteger([newArray count], equalToInteger(0)); 169 | [newArray addObject:@"lol"]; 170 | assertThat(newArray, equalTo([NSArray arrayWithObject:@"lol"])); 171 | }); 172 | }); 173 | 174 | describe(@"-$push:", ^{ 175 | it(@"adds an object", ^{ 176 | [marray $push:@"obj"]; 177 | assertThat([marray lastObject], equalTo(@"obj")); 178 | }); 179 | 180 | it(@"returns self", ^{ 181 | assertThat([marray $push:@"obj"], equalTo(marray)); 182 | }); 183 | }); 184 | 185 | describe(@"-$pop", ^{ 186 | it(@"removes last object", ^{ 187 | [marray $pop]; 188 | assertThat([marray lastObject], equalTo(@"bar")); 189 | }); 190 | 191 | it(@"returns last object", ^{ 192 | assertThat([marray $pop], equalTo(@"baz")); 193 | }); 194 | }); 195 | 196 | describe(@"-$unshift:", ^{ 197 | it(@"adds first object", ^{ 198 | [marray $unshift:@"obj"]; 199 | assertThat([marray objectAtIndex:0], equalTo(@"obj")); 200 | }); 201 | 202 | it(@"returns self", ^{ 203 | assertThat([marray $unshift:@"obj"], equalTo(marray)); 204 | }); 205 | }); 206 | 207 | describe(@"-$shift", ^{ 208 | it(@"removes first object", ^{ 209 | [marray $shift]; 210 | assertThat([marray objectAtIndex:0], equalTo(@"bar")); 211 | }); 212 | 213 | it(@"returns first object", ^{ 214 | assertThat([marray $shift], equalTo(@"foo")); 215 | }); 216 | }); 217 | }); 218 | } 219 | DESCRIBE_END -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/NSDictionaryConciseKitSpec.m: -------------------------------------------------------------------------------- 1 | #import "SpecHelper.h" 2 | #import "ConciseKit.h" 3 | 4 | DESCRIBE(NSDictionaryConciseKit) { 5 | describe(@"NSDictionary (ConciseKit)", ^{ 6 | __block NSDictionary *dict; 7 | 8 | beforeEach(^{ 9 | dict = [NSDictionary dictionaryWithObjectsAndKeys:@"bar", @"foo", 10 | @"world", @"hello", 11 | nil]; 12 | }); 13 | 14 | describe(@"$dict", ^{ 15 | it(@"creates a dictionary", ^{ 16 | assertThat($dict(@"bar", @"foo", @"world", @"hello"), equalTo(dict)); 17 | }); 18 | }); 19 | 20 | describe(@"-$for:", ^{ 21 | it(@"returns the object for the given key", ^{ 22 | assertThat([dict $for:@"foo"], equalTo(@"bar")); 23 | }); 24 | }); 25 | 26 | describe(@"-$keys:", ^{ 27 | it(@"returns the keys for the dict", ^{ 28 | assertThat([[dict $keys] $join], equalTo(@"foohello")); 29 | }); 30 | }); 31 | 32 | describe(@"-$values:", ^{ 33 | it(@"returns the values for the dict", ^{ 34 | assertThat([[dict $values] $join], equalTo(@"barworld")); 35 | }); 36 | }); 37 | 38 | describe(@"-$each:", ^{ 39 | it(@"runs block for each key value pair, passing the key and value as arguments", ^{ 40 | NSMutableArray *result = $marrnew; 41 | [dict $each:^(id key, id value) { 42 | [result $push:[key $append:value]]; 43 | }]; 44 | assertThat([result $first], equalTo(@"foobar")); 45 | assertThat([result $last], equalTo(@"helloworld")); 46 | }); 47 | }); 48 | 49 | describe(@"-$eachWithStop:", ^{ 50 | it(@"runs block for each key value pair, passing the key and value as an argument, until stop is set to YES", ^{ 51 | NSMutableArray *result = $marrnew; 52 | [dict $eachWithStop:^(id key, id value, BOOL *stop) { 53 | [result $push:[key $append:value]]; 54 | if($eql(key, @"foo")) { 55 | *stop = YES; 56 | } 57 | }]; 58 | assertThatInteger([result count], equalToInteger(1)); 59 | assertThat([result $last], equalTo(@"foobar")); 60 | }); 61 | }); 62 | 63 | describe(@"-$eachKey:", ^{ 64 | it(@"runs block for each key, passing the key as an argument", ^{ 65 | NSMutableArray *result = $marrnew; 66 | [dict $eachKey:^(id key) { 67 | [result $push:key]; 68 | }]; 69 | assertThat([result $join], equalTo(@"foohello")); 70 | }); 71 | }); 72 | 73 | describe(@"-$eachValue:", ^{ 74 | it(@"runs block for each value, passing the value as an argument", ^{ 75 | NSMutableArray *result = $marrnew; 76 | [dict $eachValue:^(id value) { 77 | [result $push:value]; 78 | }]; 79 | assertThat([result $join], equalTo(@"barworld")); 80 | }); 81 | }); 82 | }); 83 | 84 | describe(@"NSMutableDictionary (ConciseKit)", ^{ 85 | __block NSMutableDictionary *mdict; 86 | 87 | beforeEach(^{ 88 | mdict = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"bar", @"foo", 89 | @"world", @"hello", 90 | nil]; 91 | }); 92 | 93 | describe(@"$mdict", ^{ 94 | it(@"creates a mutable dictionary", ^{ 95 | NSMutableDictionary *newDict = $mdict(@"bar", @"foo", @"world", @"hello"); 96 | assertThat(newDict, equalTo(mdict)); 97 | [newDict setObject:@"qux" forKey:@"baz"]; 98 | assertThat(newDict, equalTo([NSDictionary dictionaryWithObjectsAndKeys:@"bar", @"foo", @"world", @"hello", @"qux", @"baz", nil])); 99 | }); 100 | }); 101 | 102 | describe(@"$mdictnew", ^{ 103 | it(@"creates an empty mutable dictionary", ^{ 104 | NSMutableDictionary *newDict = $mdictnew; 105 | assertThatInteger([newDict count], equalToInteger(0)); 106 | [newDict setObject:@"qux" forKey:@"baz"]; 107 | assertThat(newDict, equalTo([NSDictionary dictionaryWithObjectsAndKeys:@"qux", @"baz", nil])); 108 | }); 109 | }); 110 | 111 | describe(@"-$obj:for:", ^{ 112 | it(@"sets an object for a key", ^{ 113 | [mdict $obj:@"qux" for:@"baz"]; 114 | assertThat([mdict objectForKey:@"baz"], equalTo(@"qux")); 115 | }); 116 | 117 | it(@"returns self", ^{ 118 | assertThat([mdict $obj:@"qux" for:@"baz"], equalTo(mdict)); 119 | }); 120 | }); 121 | }); 122 | } 123 | DESCRIBE_END -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/NSSetConciseKitSpec.m: -------------------------------------------------------------------------------- 1 | #import "SpecHelper.h" 2 | #import "ConciseKit.h" 3 | 4 | DESCRIBE(NSSetConciseKit) { 5 | describe(@"NSSet (ConciseKit)", ^{ 6 | __block NSSet *set; 7 | 8 | beforeEach(^{ 9 | set = [NSSet setWithObjects:@"foo", @"bar", @"baz", nil]; 10 | }); 11 | 12 | describe(@"$set", ^{ 13 | it(@"creates a set", ^{ 14 | assertThat($set(@"foo", @"bar", @"baz"), equalTo(set)); 15 | }); 16 | }); 17 | }); 18 | 19 | describe(@"NSMutableSet (ConciseKit)", ^{ 20 | __block NSMutableSet *mset; 21 | 22 | beforeEach(^{ 23 | mset = [NSMutableSet setWithObjects:@"foo", @"bar", @"baz", nil]; 24 | }); 25 | 26 | describe(@"$mset", ^{ 27 | it(@"creates a mutable set", ^{ 28 | NSMutableSet *mset = $mset(@"foo", @"bar", @"baz"); 29 | assertThat(mset, equalTo(mset)); 30 | [mset addObject:@"lol"]; 31 | assertThat(mset, equalTo([NSSet setWithObjects:@"foo", @"bar", @"baz", @"lol", nil])); 32 | }); 33 | }); 34 | 35 | describe(@"$msetnew", ^{ 36 | it(@"creates an empty mutable set", ^{ 37 | NSMutableSet *newSet = $msetnew; 38 | assertThatInteger([newSet count], equalToInteger(0)); 39 | [newSet addObject:@"lol"]; 40 | assertThat(newSet, equalTo([NSSet setWithObjects:@"lol", nil])); 41 | }); 42 | }); 43 | }); 44 | } 45 | DESCRIBE_END -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/NSStringConciseKitSpec.m: -------------------------------------------------------------------------------- 1 | #import "SpecHelper.h" 2 | #import "ConciseKit.h" 3 | 4 | DESCRIBE(NSStringConciseKit) { 5 | describe(@"NSString (ConciseKit)", ^{ 6 | __block NSString *string; 7 | 8 | beforeEach(^{ 9 | string = @"foo"; 10 | }); 11 | 12 | describe(@"$str", ^{ 13 | it(@"creates a string using a given format", ^{ 14 | assertThat($str(@"%@%@", @"foo", @"bar"), equalTo(@"foobar")); 15 | }); 16 | }); 17 | 18 | describe(@"-$append", ^{ 19 | it(@"appends another string", ^{ 20 | assertThat([string $append:@"bar"], equalTo(@"foobar")); 21 | }); 22 | }); 23 | 24 | describe(@"-$prepend", ^{ 25 | it(@"prepends another string", ^{ 26 | assertThat([string $prepend:@"bar"], equalTo(@"barfoo")); 27 | }); 28 | }); 29 | 30 | describe(@"-$split:", ^{ 31 | it(@"divides string into an array of strings by a given string", ^{ 32 | assertThat([@"f,o,o" $split:@","], equalTo($arr(@"f",@"o",@"o"))); 33 | }); 34 | }); 35 | 36 | describe(@"-$split", ^{ 37 | it(@"divides string into an array of strings using whitespace", ^{ 38 | assertThat([@"ab cd ef" $split], equalTo($arr(@"ab",@"cd",@"ef"))); 39 | }); 40 | }); 41 | }); 42 | 43 | describe(@"NSMutableString (ConciseKit)", ^{ 44 | __block NSMutableString *mstring; 45 | 46 | beforeEach(^{ 47 | mstring = [NSMutableString stringWithString:@"foo"]; 48 | }); 49 | 50 | describe(@"$mstr", ^{ 51 | it(@"creates a mutable string using a given format", ^{ 52 | mstring = $mstr(@"%@%@", @"foo", @"bar"); 53 | assertThat(mstring, equalTo(@"foobar")); 54 | [mstring appendString:@"baz"]; 55 | assertThat(mstring, equalTo(@"foobarbaz")); 56 | }); 57 | }); 58 | 59 | describe(@"$mstrnew", ^{ 60 | it(@"creates an empty mutable string", ^{ 61 | NSMutableString *newString = $mstrnew; 62 | assertThatInteger([newString length], equalToInteger(0)); 63 | [newString appendString:@"lol"]; 64 | assertThat(newString, equalTo(@"lol")); 65 | }); 66 | }); 67 | 68 | describe(@"-$append_", ^{ 69 | it(@"appends another string and returns self", ^{ 70 | assertThat([mstring $append_:@"bar"], equalTo(@"foobar")); 71 | }); 72 | }); 73 | 74 | describe(@"-$prepend_", ^{ 75 | it(@"prepends another string and returns self", ^{ 76 | assertThat([mstring $prepend_:@"bar"], equalTo(@"barfoo")); 77 | assertThat(mstring, equalTo(@"barfoo")); 78 | }); 79 | }); 80 | 81 | describe(@"-$insert:at:", ^{ 82 | it(@"inserts a string at given position and returns self", ^{ 83 | assertThat([mstring $insert:@"bar" at:1], equalTo(@"fbaroo")); 84 | assertThat(mstring, equalTo(@"fbaroo")); 85 | }); 86 | }); 87 | 88 | describe(@"-$set:", ^{ 89 | it(@"sets the mutable string to be given string", ^{ 90 | assertThat([mstring $set:@"bar"], equalTo(@"bar")); 91 | assertThat(mstring, equalTo(@"bar")); 92 | }); 93 | }); 94 | }); 95 | } 96 | DESCRIBE_END -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/CedarAdditions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | void context(NSString *, CDRSpecBlock); 7 | void xcontext(NSString *, CDRSpecBlock); 8 | void xdescribe(NSString *, CDRSpecBlock); 9 | void xit(NSString *, CDRSpecBlock); 10 | #ifdef __cplusplus 11 | } 12 | #endif -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/CedarAdditions.m: -------------------------------------------------------------------------------- 1 | #import "CedarAdditions.h" 2 | #import 3 | 4 | void context(NSString *text, CDRSpecBlock block) { 5 | describe(text, block); 6 | } 7 | 8 | void xcontext(NSString *text, CDRSpecBlock block) { 9 | it(text, PENDING); 10 | } 11 | 12 | void xdescribe(NSString *text, CDRSpecBlock block) { 13 | it(text, PENDING); 14 | } 15 | 16 | void xit(NSString *text, CDRSpecBlock block) { 17 | it(text, PENDING); 18 | } 19 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/ConciseKitSpecs-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | Specs 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/ConciseKitSpecsAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface ConciseKitSpecsAppDelegate : NSObject {} 5 | @end 6 | 7 | @implementation ConciseKitSpecsAppDelegate 8 | 9 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 10 | runAllSpecs(); 11 | exit(0); 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/SpecHelper.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CedarAdditions.h" 3 | #import 4 | #define HC_SHORTHAND 5 | #import 6 | -------------------------------------------------------------------------------- /ConciseKitSpecs/Spec/Support/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) { 4 | return NSApplicationMain(argc, (const char **)argv); 5 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Peter Jihoon Kim 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ConciseKit 2 | 3 | A set of Objective-C additions and macros that lets you to write code more quickly. 4 | 5 | ## Pull requests are welcome! 6 | 7 | ## USAGE 8 | 9 | Use [CocoaPods](https://github.com/CocoaPods/CocoaPods) 10 | 11 | ```ruby 12 | dependency 'ConciseKit', '~> 0.1.2' 13 | ``` 14 | 15 | or 16 | 17 | 1. Copy files under `src/` to your project. 18 | 19 | ```objective-c 20 | #import "ConciseKit.h" 21 | ``` 22 | 23 | ## $ class 24 | 25 | ### Method Swizzling 26 | 27 | [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[Foo class]] 28 | [$ swizzleMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]] 29 | 30 | [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[Foo class]] 31 | [$ swizzleClassMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]] 32 | 33 | ### Path 34 | 35 | [$ homePath] => path to user's home directory 36 | [$ desktopPath] => path to user's desktop directory 37 | [$ documentPath] => path to user's document directory 38 | [$ appPath] => path to app directory 39 | [$ resourcePath] => path to app's resources directory 40 | 41 | ### waitUntil 42 | 43 | Useful when writing tests for asynchronous tasks. Default timeout is 10 seconds, checking is done every 0.1 seconds. 44 | 45 | [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) }] 46 | [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) } timeOut:10.0] 47 | [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) } timeOut:10.0 interval:0.1] 48 | 49 | ## Singleton 50 | 51 | ### Creating Singletons 52 | 53 | @interface Foo 54 | - (id)initSingleton; // <= add these to the interface 55 | + (Foo *)sharedFoo; // <= where Foo is the class name 56 | @end 57 | 58 | @implementation Foo 59 | $singleton(Foo); // => makes Foo a singleton class 60 | 61 | - (id)initSingleton { 62 | foo = 1; // do initialization in -initSingleton method 63 | bar = 2; 64 | return self; 65 | } 66 | @end 67 | 68 | ### Using Singletons 69 | 70 | $shared(Foo) // => returns the shared instance 71 | /* or */ 72 | [Foo sharedFoo] 73 | 74 | ## Macros 75 | 76 | ### General shorthands 77 | 78 | $new(Foo) => [[[Foo alloc] init] autorelease] 79 | $eql(foo, bar) => [foo isEqual:bar] 80 | $safe(obj) => (obj == [NSNull null] ? nil : obj) 81 | 82 | ### NSArray shorthands 83 | 84 | $arr(foo, bar) => [NSArray arrayWithObjects:foo, bar, nil] 85 | $marr(foo, bar) => [NSMutableArray ...] 86 | $marrnew or $marr(nil) => [NSMutableArray array] 87 | 88 | ### NSSet shorthands 89 | 90 | $set(foo, bar) => [NSSet setWithObjects:foo, bar, nil] 91 | $mset(foo, bar) => [NSMutableSet ...] 92 | $msetnew or $mset(nil) => [NSMutableSet set] 93 | 94 | ### NSDictionary shorthands 95 | 96 | $dict(v1, k1, v2, k2) => [NSDictionary dictionaryWithObjectsAndKeys:v1, k1, v2, k2, nil] 97 | $mdict(v1, k1, v2, k2) => [NSMutableDictionary ...] 98 | $mdictnew or $mdict(nil) => [NSMutableDictionary dictionary] 99 | 100 | ### NSString shorthands 101 | 102 | $str(@"foo: %@", bar) => [NSString stringWithFormat:@"foo: %@", bar] 103 | $mstr(@"foo: %@", bar) => [NSMutableString ...] 104 | $mstrnew or $mstr(nil) => [NSMutableString string] 105 | 106 | ### NSNumber shorthands 107 | 108 | $bool(YES) => [NSNumber numberWithBool:YES] 109 | $int(123) => [NSNumber numberWithInt:123] 110 | $float(123.4) => [NSNumber numberWithFloat:123.4] 111 | 112 | $char(), $double(), $integer(), $long(), $longlong(), $short(), 113 | $uchar(), $uint(), $uinteger(), $ulong(), $ulonglong(), $ushort() 114 | 115 | ### NSValue shorthands 116 | $nonretained(), $pointer(), $point(), $range(), $rect(), $size() 117 | 118 | ## Additions 119 | 120 | ### NSArray 121 | 122 | [array $first] => [array objectAtIndex:0] 123 | [array $last] => [array lastObject] 124 | [array $at:1] => [array objectAtIndex:1] 125 | 126 | [array $each:^(id obj) { 127 | NSLog(@"%@", obj); 128 | }] 129 | 130 | [array $eachWithIndex:^(id obj, NSUInteger i) { 131 | NSLog(@"%d %@", i, obj); 132 | }] 133 | 134 | [array $eachWithStop:^(id obj, BOOL *stop) { 135 | NSLog(@"%@", obj); 136 | if($eql(obj, @"foo")) { 137 | *stop = YES; 138 | } 139 | }] 140 | 141 | [array $eachWithIndexAndStop:^(id obj, NSUInteger i, BOOL *stop) { 142 | NSLog(@"%d %@", i, obj); 143 | if(i == 1) { 144 | *stop = YES; 145 | } 146 | }] 147 | 148 | [array $map:^(id obj) { 149 | return $integer([obj integerValue] * 2); 150 | }] 151 | 152 | [array $mapWithIndex:^(id obj, NSUInteger i) { 153 | return $integer([obj integerValue] * 2 + i); 154 | }] 155 | 156 | [array $reduce:^(id obj) { 157 | return $integer([obj integerValue] * 2); 158 | }] 159 | 160 | [array $reduce:^(NSNumber *memo, NSNumber *obj) { 161 | return $integer([memo integerValue] + [obj integerValue]); 162 | }] 163 | 164 | [array $reduceStartingAt:$integer(1) with:^(NSNumber *memo, NSNumber *obj) { 165 | return $integer([memo integerValue] * [obj integerValue]); 166 | }] 167 | 168 | [array $select:^BOOL(NSNumber *obj) { 169 | return ([obj integerValue] % 2) == 0; 170 | }] 171 | 172 | [array $detect:^BOOL(NSNumber *obj) { 173 | return ([obj integerValue] % 2) == 1; 174 | }] 175 | 176 | [array $join] => [self componentsJoinedByString:@""] 177 | [array $join:@","] => [self componentsJoinedByString:@","] 178 | 179 | ### NSMutableArray 180 | 181 | [array $push:foo] => [array addObject:foo] (+ returns self) 182 | [array $pop] => [array removeLastObject] (+ returns lastObject) 183 | [array $unshift:foo] => [array insertObject:foo atIndex:0] (+ returns self) 184 | [array $shift] => [array removeObjectAtIndex:0] (+ returns first object) 185 | 186 | ### NSDictionary 187 | 188 | [dict $for:@"foo"] => [dict objectForKey:@"foo"] 189 | [dict $keys] => [dict allKeys] 190 | [dict $values] => [dict allValues] 191 | 192 | [dict $each:^(id key, id value) { 193 | NSLog(@"%@ => %@", key, value); 194 | } 195 | 196 | [dict $eachWithStop:^(id key, id value, BOOL *stop) { 197 | NSLog(@"%@ => %@", key, value); 198 | if($eql(key, @"foo")) { 199 | *stop = YES; 200 | } 201 | }] 202 | 203 | [dict $eachKey:^(id key) { 204 | NSLog(@"%@", key); 205 | }] 206 | 207 | [dict $eachValue:^(id value) { 208 | NSLog(@"%@", value); 209 | }] 210 | 211 | ### NSMutableDictionary 212 | 213 | [dict $obj:@"bar" for:@"foo"] => [dict setObject:@"bar" forKey:@"foo"] (+ returns self) 214 | 215 | ### NSString 216 | 217 | [string $append:@"foo"] => [string stringByAppendString:@"foo"] 218 | [string $prepend:@"foo"] => [NSString stringWithFormat:@"%@%@", @"foo", string] 219 | [string $split:@","] => [string componentsSeparatedByString:@","] 220 | [string $split] => [string componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] 221 | 222 | ### NSMutableString 223 | 224 | [string $append_:@"foo"] => [string appendString:@"foo"] (+ returns self) 225 | [string $prepend_:@"foo"] => [string insertString:@"foo" atIndex:0] (+ returns self) 226 | [string $insert:@"foo" at:1] => [string insertString:@"foo" atIndex:1] (+ returns self) 227 | [string $set:@"foo"] => [string setString:@"foo"] (+ returns self) 228 | 229 | ## Contributors 230 | 231 | * [nolanw](http://github.com/nolanw) 232 | * [listrophy](https://github.com/listrophy) 233 | * [gerry3](https://github.com/gerry3) @ [Inigral](https://github.com/inigral) 234 | 235 | ## License 236 | 237 | Copyright (c) 2010-2012 Peter Jihoon Kim and contributors. This code is licensed under the [MIT License](http://github.com/petejkim/ConciseKit/raw/master/LICENSE). 238 | -------------------------------------------------------------------------------- /src/CKAdditions.h: -------------------------------------------------------------------------------- 1 | #import "NSArray+ConciseKit.h" 2 | #import "NSString+ConciseKit.h" 3 | #import "NSDictionary+ConciseKit.h" -------------------------------------------------------------------------------- /src/CKMacros.h: -------------------------------------------------------------------------------- 1 | #ifndef __has_feature 2 | #define __has_feature(x) 0 3 | #endif 4 | #if __has_feature(objc_arc) 5 | #define IF_ARC(with, without) with 6 | #else 7 | #define IF_ARC(with, without) without 8 | #endif 9 | 10 | #define $new(Klass) IF_ARC([[Klass alloc] init], [[[Klass alloc] init] autorelease]) 11 | #define $eql(a,b) [(a) isEqual:(b)] 12 | 13 | #define $arr(...) [NSArray arrayWithObjects:__VA_ARGS__, nil] 14 | #define $marr(...) [NSMutableArray arrayWithObjects:__VA_ARGS__, nil] 15 | #define $marrnew [NSMutableArray array] 16 | #define $set(...) [NSSet setWithObjects:__VA_ARGS__, nil] 17 | #define $mset(...) [NSMutableSet setWithObjects:__VA_ARGS__, nil] 18 | #define $msetnew [NSMutableSet set] 19 | #define $dict(...) [NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil] 20 | #define $mdict(...) [NSMutableDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil] 21 | #define $mdictnew [NSMutableDictionary dictionary] 22 | #define $str(...) [NSString stringWithFormat:__VA_ARGS__] 23 | #define $mstr(...) [NSMutableString stringWithFormat:__VA_ARGS__] 24 | #define $mstrnew [NSMutableString string] 25 | 26 | #define $bool(val) [NSNumber numberWithBool:(val)] 27 | #define $char(val) [NSNumber numberWithChar:(val)] 28 | #define $double(val) [NSNumber numberWithDouble:(val)] 29 | #define $float(val) [NSNumber numberWithFloat:(val)] 30 | #define $int(val) [NSNumber numberWithInt:(val)] 31 | #define $integer(val) [NSNumber numberWithInteger:(val)] 32 | #define $long(val) [NSNumber numberWithLong:(val)] 33 | #define $longlong(val) [NSNumber numberWithLongLong:(val)] 34 | #define $short(val) [NSNumber numberWithShort:(val)] 35 | #define $uchar(val) [NSNumber numberWithUnsignedChar:(val)] 36 | #define $uint(val) [NSNumber numberWithUnsignedInt:(val)] 37 | #define $uinteger(val) [NSNumber numberWithUnsignedInteger:(val)] 38 | #define $ulong(val) [NSNumber numberWithUnsignedLong:(val)] 39 | #define $ulonglong(val) [NSNumber numberWithUnsignedLongLong:(val)] 40 | #define $ushort(val) [NSNumber numberWithUnsignedShort:(val)] 41 | 42 | #define $nonretained(val) [NSValue valueWithNonretainedObject:(val)] 43 | #define $pointer(val) [NSValue valueWithPointer:(val)] 44 | #define $point(val) [NSValue valueWithPoint:(val)] 45 | #define $range(val) [NSValue valueWithRange:(val)] 46 | #define $rect(val) [NSValue valueWithRect:(val)] 47 | #define $size(val) [NSValue valueWithSize:(val)] 48 | 49 | #define $safe(obj) ((NSNull *)(obj) == [NSNull null] ? nil : (obj)) 50 | -------------------------------------------------------------------------------- /src/CKSingleton.h: -------------------------------------------------------------------------------- 1 | #define $shared(Klass) [Klass shared##Klass] 2 | 3 | #ifdef ALLOW_ALLOC_INIT_FOR_SINGLETONS 4 | #define $singleton(Klass)\ 5 | \ 6 | static Klass *shared##Klass = nil;\ 7 | \ 8 | + (Klass *)shared##Klass {\ 9 | @synchronized(self) {\ 10 | if(shared##Klass == nil) {\ 11 | shared##Klass = [[super allocWithZone:NULL] initSingleton];\ 12 | }\ 13 | }\ 14 | return shared##Klass;\ 15 | }\ 16 | \ 17 | - (id)init {\ 18 | if((self = [super init])) {\ 19 | [self initSingleton];\ 20 | }\ 21 | return self;\ 22 | } 23 | #else 24 | #define $singleton(Klass)\ 25 | \ 26 | static Klass *shared##Klass = nil;\ 27 | \ 28 | + (Klass *)shared##Klass {\ 29 | @synchronized(self) {\ 30 | if(shared##Klass == nil) {\ 31 | shared##Klass = [[super allocWithZone:NULL] init];\ 32 | }\ 33 | }\ 34 | return shared##Klass;\ 35 | }\ 36 | \ 37 | + (id)allocWithZone:(NSZone *)zone {\ 38 | return [[self shared##Klass] retain];\ 39 | }\ 40 | \ 41 | - (id)copyWithZone:(NSZone *)zone {\ 42 | return self;\ 43 | }\ 44 | \ 45 | - (id)retain {\ 46 | return self;\ 47 | }\ 48 | \ 49 | - (NSUInteger)retainCount {\ 50 | return NSUIntegerMax;\ 51 | }\ 52 | \ 53 | - (void)release {}\ 54 | \ 55 | - (id)autorelease {\ 56 | return self;\ 57 | }\ 58 | \ 59 | + (BOOL)isShared##Klass##Present {\ 60 | return shared##Klass != nil;\ 61 | }\ 62 | \ 63 | - (id)init {\ 64 | if(![[self class] isShared##Klass##Present]) {\ 65 | if((self = [super init])) {\ 66 | [self initSingleton];\ 67 | }\ 68 | }\ 69 | return self;\ 70 | } 71 | #endif -------------------------------------------------------------------------------- /src/ConciseKit.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CKMacros.h" 3 | #import "CKAdditions.h" 4 | #import "CKSingleton.h" 5 | 6 | @interface ConciseKit : NSObject {} 7 | 8 | + (NSString *)homePath; 9 | + (NSString *)desktopPath; 10 | + (NSString *)documentPath; 11 | + (NSString *)appPath; 12 | + (NSString *)resourcePath; 13 | 14 | + (BOOL)swizzleMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass; 15 | + (BOOL)swizzleMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass; 16 | + (BOOL)swizzleClassMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass; 17 | + (BOOL)swizzleClassMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass; 18 | 19 | + (void)waitUntil:(BOOL (^)(void))condition; 20 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut; 21 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval; 22 | 23 | @end 24 | 25 | @interface $ : ConciseKit {} 26 | @end -------------------------------------------------------------------------------- /src/ConciseKit.m: -------------------------------------------------------------------------------- 1 | #import "ConciseKit.h" 2 | #import 3 | 4 | @implementation ConciseKit 5 | 6 | + (NSString *)homePath { 7 | return NSHomeDirectory(); 8 | } 9 | 10 | + (NSString *)desktopPath { 11 | return [NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES) objectAtIndex:0]; 12 | } 13 | 14 | + (NSString *)documentPath { 15 | return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; 16 | } 17 | 18 | + (NSString *)appPath { 19 | return [[NSBundle mainBundle] bundlePath]; 20 | } 21 | 22 | + (NSString *)resourcePath { 23 | return [[NSBundle mainBundle] resourcePath]; 24 | } 25 | 26 | + (BOOL)swizzleMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass { 27 | return [self swizzleMethod:originalSelector in:klass with:anotherSelector in:klass]; 28 | } 29 | 30 | + (BOOL)swizzleMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass { 31 | Method originalMethod = class_getInstanceMethod(klass, originalSelector); 32 | Method anotherMethod = class_getInstanceMethod(anotherKlass, anotherSelector); 33 | if(!originalMethod || !anotherMethod) { 34 | return NO; 35 | } 36 | IMP originalMethodImplementation = class_getMethodImplementation(klass, originalSelector); 37 | IMP anotherMethodImplementation = class_getMethodImplementation(anotherKlass, anotherSelector); 38 | if(class_addMethod(klass, originalSelector, originalMethodImplementation, method_getTypeEncoding(originalMethod))) { 39 | originalMethod = class_getInstanceMethod(klass, originalSelector); 40 | } 41 | if(class_addMethod(anotherKlass, anotherSelector, anotherMethodImplementation, method_getTypeEncoding(anotherMethod))) { 42 | anotherMethod = class_getInstanceMethod(anotherKlass, anotherSelector); 43 | } 44 | method_exchangeImplementations(originalMethod, anotherMethod); 45 | return YES; 46 | } 47 | 48 | + (BOOL)swizzleClassMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass { 49 | return [self swizzleClassMethod:originalSelector in:klass with:anotherSelector in:klass]; 50 | } 51 | 52 | + (BOOL)swizzleClassMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass { 53 | Method originalMethod = class_getClassMethod(klass, originalSelector); 54 | Method anotherMethod = class_getClassMethod(anotherKlass, anotherSelector); 55 | if(!originalMethod || !anotherMethod) { 56 | return NO; 57 | } 58 | Class metaClass = objc_getMetaClass(class_getName(klass)); 59 | Class anotherMetaClass = objc_getMetaClass(class_getName(anotherKlass)); 60 | IMP originalMethodImplementation = class_getMethodImplementation(metaClass, originalSelector); 61 | IMP anotherMethodImplementation = class_getMethodImplementation(anotherMetaClass, anotherSelector); 62 | if(class_addMethod(metaClass, originalSelector, originalMethodImplementation, method_getTypeEncoding(originalMethod))) { 63 | originalMethod = class_getClassMethod(klass, originalSelector); 64 | } 65 | if(class_addMethod(anotherMetaClass, anotherSelector, anotherMethodImplementation, method_getTypeEncoding(anotherMethod))) { 66 | anotherMethod = class_getClassMethod(anotherKlass, anotherSelector); 67 | } 68 | method_exchangeImplementations(originalMethod, anotherMethod); 69 | return YES; 70 | } 71 | 72 | + (void)waitUntil:(BOOL (^)(void))condition { 73 | [self waitUntil:condition timeOut:10.0 interval:0.1]; 74 | } 75 | 76 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut { 77 | [self waitUntil:condition timeOut:timeOut interval:0.1]; 78 | } 79 | 80 | + (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval { 81 | NSTimeInterval sleptSoFar=0; 82 | while(1) { 83 | if(condition() || (sleptSoFar >= timeOut)) { 84 | return; 85 | } 86 | [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:interval]]; 87 | sleptSoFar += interval; 88 | } 89 | } 90 | 91 | @end 92 | 93 | @implementation $ 94 | @end -------------------------------------------------------------------------------- /src/NSArray+ConciseKit.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSArray (ConciseKit) 4 | 5 | - (id)$first; 6 | - (id)$last; 7 | - (id)$at:(NSUInteger)index; 8 | - (NSArray *)$each:(void (^)(id obj))block; 9 | - (NSArray *)$eachWithIndex:(void (^)(id obj, NSUInteger idx))block; 10 | - (NSArray *)$eachWithStop:(void (^)(id obj, BOOL *stop))block; 11 | - (NSArray *)$eachWithIndexAndStop:(void (^)(id obj, NSUInteger idx, BOOL *stop))block; 12 | - (NSArray *)$map:(id (^)(id obj))block; 13 | - (NSArray *)$mapWithIndex:(id (^)(id obj, NSUInteger idx))block; 14 | - (id)$reduce:(id (^)(id memo, id obj))block; 15 | - (id)$reduceStartingAt:(id)starting with:(id (^)(id memo, id obj))block; 16 | - (NSArray *)$select:(BOOL(^)(id obj))block; 17 | - (id)$detect:(BOOL(^)(id obj))block; 18 | - (NSString *)$join; 19 | - (NSString *)$join:(NSString *)separator; 20 | 21 | @end 22 | 23 | @interface NSMutableArray (ConciseKit) 24 | 25 | - (NSMutableArray *)$push:(id)anObject; 26 | - (id)$pop; 27 | - (NSMutableArray *)$unshift:(id)anObject; 28 | - (id)$shift; 29 | 30 | @end -------------------------------------------------------------------------------- /src/NSArray+ConciseKit.m: -------------------------------------------------------------------------------- 1 | #import "NSArray+ConciseKit.h" 2 | 3 | @implementation NSArray (ConciseKit) 4 | 5 | - (id)$first { 6 | return [self objectAtIndex:0]; 7 | } 8 | 9 | - (id)$last { 10 | return [self lastObject]; 11 | } 12 | 13 | - (id)$at:(NSUInteger)index { 14 | return [self objectAtIndex:index]; 15 | } 16 | 17 | - (NSArray *)$each:(void (^)(id obj))block { 18 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 19 | block(obj); 20 | }]; 21 | return self; 22 | } 23 | 24 | - (NSArray *)$eachWithIndex:(void (^)(id obj, NSUInteger idx))block { 25 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 26 | block(obj, idx); 27 | }]; 28 | return self; 29 | } 30 | 31 | - (NSArray *)$eachWithStop:(void (^)(id obj, BOOL *stop))block { 32 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 33 | block(obj, stop); 34 | }]; 35 | return self; 36 | } 37 | 38 | - (NSArray *)$eachWithIndexAndStop:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { 39 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 40 | block(obj, idx, stop); 41 | }]; 42 | return self; 43 | } 44 | 45 | - (NSArray *)$map:(id (^)(id obj))block { 46 | __block NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]]; 47 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 48 | [array addObject:block(obj)]; 49 | }]; 50 | return array; 51 | } 52 | 53 | - (NSArray *)$mapWithIndex:(id (^)(id obj, NSUInteger idx))block { 54 | __block NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]]; 55 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 56 | [array addObject:block(obj, idx)]; 57 | }]; 58 | return array; 59 | } 60 | 61 | - (id)$reduce:(id (^)(id memo, id obj))block { 62 | __block id ret = nil; 63 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 64 | if (idx == 0) { 65 | ret = obj; 66 | } else { 67 | ret = block(ret, obj); 68 | } 69 | }]; 70 | return ret; 71 | } 72 | 73 | - (id)$reduceStartingAt:(id)starting with:(id (^)(id memo, id obj))block { 74 | __block id ret = starting; 75 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 76 | ret = block(ret, obj); 77 | }]; 78 | return ret; 79 | } 80 | 81 | - (NSArray *)$select:(BOOL(^)(id obj))block { 82 | __block NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]]; 83 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 84 | if (block(obj)) { 85 | [array addObject:obj]; 86 | } 87 | }]; 88 | return [NSArray arrayWithArray:array]; 89 | } 90 | 91 | - (id)$detect:(BOOL(^)(id obj))block { 92 | __block id ret = nil; 93 | [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 94 | if (block(obj)) { 95 | *stop = YES; 96 | ret = obj; 97 | } 98 | }]; 99 | return ret; 100 | } 101 | 102 | - (NSString *)$join { 103 | return [self componentsJoinedByString:@""]; 104 | } 105 | 106 | - (NSString *)$join:(NSString *)separator { 107 | return [self componentsJoinedByString:separator]; 108 | } 109 | 110 | @end 111 | 112 | @implementation NSMutableArray (ConciseKit) 113 | 114 | #ifndef __has_feature 115 | #define __has_feature(x) 0 116 | #endif 117 | #if __has_feature(objc_arc) 118 | #define IF_ARC(with, without) with 119 | #else 120 | #define IF_ARC(with, without) without 121 | #endif 122 | 123 | - (NSMutableArray *)$push:(id)anObject { 124 | [self addObject:anObject]; 125 | return self; 126 | } 127 | 128 | - (id)$pop; { 129 | IF_ARC(id lastObject = [self lastObject];, id lastObject = [[[self lastObject] retain] autorelease];) 130 | [self removeLastObject]; 131 | return lastObject; 132 | } 133 | 134 | - (NSMutableArray *)$unshift:(id)anObject { 135 | [self insertObject:anObject atIndex:0]; 136 | return self; 137 | } 138 | 139 | - (id)$shift; { 140 | IF_ARC(id firstObject = [self objectAtIndex:0];, id firstObject = [[[self objectAtIndex:0] retain] autorelease];) 141 | 142 | [self removeObjectAtIndex:0]; 143 | return firstObject; 144 | } 145 | 146 | @end -------------------------------------------------------------------------------- /src/NSDictionary+ConciseKit.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSDictionary (ConciseKit) 4 | 5 | - (id)$for:(id)aKey; 6 | - (NSArray *)$keys; 7 | - (NSArray *)$values; 8 | - (NSDictionary *)$each:(void (^)(id key, id value))block; 9 | - (NSDictionary *)$eachWithStop:(void (^)(id key, id value, BOOL *stop))block; 10 | - (NSDictionary *)$eachKey:(void (^)(id key))block; 11 | - (NSDictionary *)$eachValue:(void (^)(id value))block; 12 | 13 | @end 14 | 15 | @interface NSMutableDictionary (ConciseKit) 16 | 17 | - (NSMutableDictionary *)$obj:(id)anObject for:(id)aKey; 18 | 19 | @end -------------------------------------------------------------------------------- /src/NSDictionary+ConciseKit.m: -------------------------------------------------------------------------------- 1 | #import "NSDictionary+ConciseKit.h" 2 | 3 | @implementation NSDictionary (ConciseKit) 4 | 5 | - (id)$for:(id)aKey { 6 | return [self objectForKey:aKey]; 7 | } 8 | 9 | - (NSArray *)$keys { 10 | return [self allKeys]; 11 | } 12 | 13 | - (NSArray *)$values { 14 | return [self allValues]; 15 | } 16 | 17 | - (NSDictionary *)$each:(void (^)(id key, id value))block { 18 | [self enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *stop) { 19 | block(key, value); 20 | }]; 21 | return self; 22 | } 23 | 24 | - (NSDictionary *)$eachWithStop:(void (^)(id key, id value, BOOL *stop))block { 25 | [self enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *stop) { 26 | block(key, value, stop); 27 | }]; 28 | return self; 29 | } 30 | 31 | - (NSDictionary *)$eachKey:(void (^)(id key))block { 32 | [[self allKeys] enumerateObjectsUsingBlock:^(id key, NSUInteger idx, BOOL *stop) { 33 | block(key); 34 | }]; 35 | return self; 36 | } 37 | 38 | - (NSDictionary *)$eachValue:(void (^)(id value))block { 39 | [[self allValues] enumerateObjectsUsingBlock:^(id value, NSUInteger idx, BOOL *stop) { 40 | block(value); 41 | }]; 42 | return self; 43 | } 44 | 45 | @end 46 | 47 | @implementation NSMutableDictionary (ConciseKit) 48 | 49 | - (NSMutableDictionary *)$obj:(id)anObject for:(id)aKey { 50 | [self setObject:anObject forKey:aKey]; 51 | return self; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /src/NSString+ConciseKit.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSString (ConciseKit) 4 | 5 | - (NSString *)$append:(NSString *)aString; 6 | - (NSString *)$prepend:(NSString *)aString; 7 | - (NSArray *)$split:(NSString *)aString; 8 | - (NSArray *)$split; 9 | 10 | @end 11 | 12 | @interface NSMutableString (ConciseKit) 13 | 14 | - (NSMutableString *)$append_:(NSString *)aString; 15 | - (NSMutableString *)$prepend_:(NSString *)aString; 16 | - (NSMutableString *)$insert:(NSString *)aString at:(NSUInteger)anIndex; 17 | - (NSMutableString *)$set:(NSString *)aString; 18 | 19 | @end -------------------------------------------------------------------------------- /src/NSString+ConciseKit.m: -------------------------------------------------------------------------------- 1 | #import "NSString+ConciseKit.h" 2 | 3 | @implementation NSString (ConciseKit) 4 | 5 | - (NSString *)$append:(NSString *)aString { 6 | return [self stringByAppendingString:aString]; 7 | } 8 | 9 | - (NSString *)$prepend:(NSString *)aString { 10 | return [NSString stringWithFormat:@"%@%@", aString, self]; 11 | } 12 | 13 | - (NSArray *)$split:(NSString *)aString { 14 | return [self componentsSeparatedByString:aString]; 15 | } 16 | 17 | - (NSArray *)$split { 18 | return [self componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 19 | } 20 | 21 | @end 22 | 23 | @implementation NSMutableString (ConciseKit) 24 | 25 | - (NSMutableString *)$append_:(NSString *)aString { 26 | [self appendString:aString]; 27 | return self; 28 | } 29 | 30 | - (NSMutableString *)$prepend_:(NSString *)aString { 31 | [self insertString:aString atIndex:0]; 32 | return self; 33 | } 34 | 35 | - (NSMutableString *)$insert:(NSString *)aString at:(NSUInteger)anIndex { 36 | [self insertString:aString atIndex:anIndex]; 37 | return self; 38 | } 39 | 40 | - (NSMutableString *)$set:(NSString *)aString { 41 | [self setString:aString]; 42 | return self; 43 | } 44 | 45 | @end --------------------------------------------------------------------------------