Permalink
Browse files

First release.

  • Loading branch information...
0 parents commit 4f0c6270207cafacf4c1d5508351c72a361ee894 @allending committed Jun 13, 2010
Showing with 13,422 additions and 0 deletions.
  1. +10 −0 .gitignore
  2. +11 −0 Classes/Carrier.h
  3. +11 −0 Classes/Carrier.m
  4. +78 −0 Classes/Cruiser.h
  5. +136 −0 Classes/Cruiser.m
  6. +11 −0 Classes/Engine.h
  7. +11 −0 Classes/Engine.m
  8. +34 −0 Classes/Fighter.h
  9. +46 −0 Classes/Fighter.m
  10. +18 −0 Classes/JumpCapable.h
  11. +19 −0 Classes/KiwiAppDelegate.h
  12. +28 −0 Classes/KiwiAppDelegate.m
  13. +12 −0 Classes/KiwiViewController.h
  14. +61 −0 Classes/KiwiViewController.m
  15. +17 −0 Classes/OrbitCapable.h
  16. +16 −0 Classes/SpaceShip.h
  17. +18 −0 Classes/SpaceShip.m
  18. +16 −0 Classes/TestClasses.h
  19. +41 −0 Classes/TestReporter.h
  20. +73 −0 Classes/TestReporter.m
  21. +24 −0 Classes/TestSpy.h
  22. +27 −0 Classes/TestSpy.m
  23. +24 −0 Classes/TestVerifier.h
  24. +38 −0 Classes/TestVerifier.m
  25. +61 −0 Examples/ExampleSpec.m
  26. +224 −0 Examples/ExampleTestCase.m
  27. +38 −0 Examples/SimpleSpec.m
  28. +1,362 −0 Kiwi.xcodeproj/project.pbxproj
  29. +22 −0 Kiwi/KWAfterAllNode.h
  30. +30 −0 Kiwi/KWAfterAllNode.m
  31. +22 −0 Kiwi/KWAfterEachNode.h
  32. +30 −0 Kiwi/KWAfterEachNode.m
  33. +23 −0 Kiwi/KWBeBetweenMatcher.h
  34. +79 −0 Kiwi/KWBeBetweenMatcher.m
  35. +20 −0 Kiwi/KWBeEmptyMatcher.h
  36. +74 −0 Kiwi/KWBeEmptyMatcher.m
  37. +20 −0 Kiwi/KWBeIdenticalToMatcher.h
  38. +72 −0 Kiwi/KWBeIdenticalToMatcher.m
  39. +20 −0 Kiwi/KWBeKindOfClassMatcher.h
  40. +55 −0 Kiwi/KWBeKindOfClassMatcher.m
  41. +20 −0 Kiwi/KWBeMemberOfClassMatcher.h
  42. +55 −0 Kiwi/KWBeMemberOfClassMatcher.m
  43. +23 −0 Kiwi/KWBeTrueMatcher.h
  44. +69 −0 Kiwi/KWBeTrueMatcher.m
  45. +22 −0 Kiwi/KWBeWithinMatcher.h
  46. +109 −0 Kiwi/KWBeWithinMatcher.m
  47. +17 −0 Kiwi/KWBeZeroMatcher.h
  48. +48 −0 Kiwi/KWBeZeroMatcher.m
  49. +22 −0 Kiwi/KWBeforeAllNode.h
  50. +30 −0 Kiwi/KWBeforeAllNode.m
  51. +22 −0 Kiwi/KWBeforeEachNode.h
  52. +30 −0 Kiwi/KWBeforeEachNode.m
  53. +37 −0 Kiwi/KWBlock.h
  54. +67 −0 Kiwi/KWBlock.m
  55. +43 −0 Kiwi/KWBlockNode.h
  56. +55 −0 Kiwi/KWBlockNode.m
  57. +28 −0 Kiwi/KWBlockRaiseMatcher.h
  58. +125 −0 Kiwi/KWBlockRaiseMatcher.m
  59. +33 −0 Kiwi/KWCallSite.h
  60. +56 −0 Kiwi/KWCallSite.m
  61. +20 −0 Kiwi/KWConformToProtocolMatcher.h
  62. +55 −0 Kiwi/KWConformToProtocolMatcher.m
  63. +31 −0 Kiwi/KWContainMatcher.h
  64. +104 −0 Kiwi/KWContainMatcher.m
  65. +71 −0 Kiwi/KWContextNode.h
  66. +105 −0 Kiwi/KWContextNode.m
  67. +15 −0 Kiwi/KWCountType.h
  68. +17 −0 Kiwi/KWDeviceInfo.h
  69. +33 −0 Kiwi/KWDeviceInfo.m
  70. +20 −0 Kiwi/KWEqualMatcher.h
  71. +69 −0 Kiwi/KWEqualMatcher.m
  72. +37 −0 Kiwi/KWExampleGroup.h
  73. +89 −0 Kiwi/KWExampleGroup.m
  74. +44 −0 Kiwi/KWExampleGroupBuilder.h
  75. +187 −0 Kiwi/KWExampleGroupBuilder.m
  76. +22 −0 Kiwi/KWExampleNode.h
  77. +36 −0 Kiwi/KWExampleNodeVisitor.h
  78. +35 −0 Kiwi/KWExistVerifier.h
  79. +70 −0 Kiwi/KWExistVerifier.m
  80. +14 −0 Kiwi/KWExpectationType.h
  81. +37 −0 Kiwi/KWFailure.h
  82. +65 −0 Kiwi/KWFailure.m
  83. +16 −0 Kiwi/KWFormatter.h
  84. +38 −0 Kiwi/KWFormatter.m
  85. +54 −0 Kiwi/KWHaveMatcher.h
  86. +254 −0 Kiwi/KWHaveMatcher.m
  87. +33 −0 Kiwi/KWInequalityMatcher.h
  88. +117 −0 Kiwi/KWInequalityMatcher.m
  89. +47 −0 Kiwi/KWIntercept.h
  90. +276 −0 Kiwi/KWIntercept.m
  91. +42 −0 Kiwi/KWInvocationCapturer.h
  92. +97 −0 Kiwi/KWInvocationCapturer.m
  93. +24 −0 Kiwi/KWItNode.h
  94. +30 −0 Kiwi/KWItNode.m
  95. +45 −0 Kiwi/KWMatchVerifier.h
  96. +164 −0 Kiwi/KWMatchVerifier.m
  97. +48 −0 Kiwi/KWMatcher.h
  98. +82 −0 Kiwi/KWMatcher.m
  99. +42 −0 Kiwi/KWMatcherFactory.h
  100. +122 −0 Kiwi/KWMatcherFactory.m
  101. +43 −0 Kiwi/KWMatching.h
  102. +49 −0 Kiwi/KWMessagePattern.h
  103. +223 −0 Kiwi/KWMessagePattern.m
  104. +16 −0 Kiwi/KWMessageSpying.h
  105. +53 −0 Kiwi/KWMessageTracker.h
  106. +151 −0 Kiwi/KWMessageTracker.m
  107. +88 −0 Kiwi/KWMock.h
  108. +556 −0 Kiwi/KWMock.m
  109. +19 −0 Kiwi/KWNull.h
  110. +47 −0 Kiwi/KWNull.m
  111. +31 −0 Kiwi/KWObjCUtilities.h
  112. +97 −0 Kiwi/KWObjCUtilities.m
  113. +39 −0 Kiwi/KWPendingNode.h
  114. +55 −0 Kiwi/KWPendingNode.m
  115. +25 −0 Kiwi/KWRaiseMatcher.h
  116. +121 −0 Kiwi/KWRaiseMatcher.m
  117. +61 −0 Kiwi/KWReceiveMatcher.h
  118. +308 −0 Kiwi/KWReceiveMatcher.m
  119. +39 −0 Kiwi/KWRegisterMatchersNode.h
  120. +55 −0 Kiwi/KWRegisterMatchersNode.m
  121. +18 −0 Kiwi/KWReporting.h
  122. +20 −0 Kiwi/KWRespondToSelectorMatcher.h
  123. +55 −0 Kiwi/KWRespondToSelectorMatcher.m
  124. +49 −0 Kiwi/KWSpec.h
  125. +321 −0 Kiwi/KWSpec.m
  126. +20 −0 Kiwi/KWStringUtilities.h
  127. +90 −0 Kiwi/KWStringUtilities.m
  128. +37 −0 Kiwi/KWStub.h
  129. +131 −0 Kiwi/KWStub.m
  130. +44 −0 Kiwi/KWTestCase.h
  131. +185 −0 Kiwi/KWTestCase.m
  132. +96 −0 Kiwi/KWValue.h
  133. +352 −0 Kiwi/KWValue.m
  134. +21 −0 Kiwi/KWVerifying.h
  135. +18 −0 Kiwi/KWWorkarounds.h
  136. +26 −0 Kiwi/KWWorkarounds.m
  137. +73 −0 Kiwi/Kiwi.h
  138. +28 −0 Kiwi/KiwiConfiguration.h
  139. +67 −0 Kiwi/KiwiMacros.h
  140. +28 −0 Kiwi/NSInvocation+KiwiAdditions.h
  141. +93 −0 Kiwi/NSInvocation+KiwiAdditions.m
  142. +17 −0 Kiwi/NSMethodSignature+KiwiAdditions.h
  143. +22 −0 Kiwi/NSMethodSignature+KiwiAdditions.m
  144. +31 −0 Kiwi/NSNumber+KiwiAdditions.h
  145. +111 −0 Kiwi/NSNumber+KiwiAdditions.m
  146. +20 −0 Kiwi/NSObject+KiwiMockAdditions.h
  147. +31 −0 Kiwi/NSObject+KiwiMockAdditions.m
  148. +36 −0 Kiwi/NSObject+KiwiStubAdditions.h
  149. +108 −0 Kiwi/NSObject+KiwiStubAdditions.m
  150. +19 −0 Kiwi/NSObject+KiwiVerifierAdditions.h
  151. +26 −0 Kiwi/NSObject+KiwiVerifierAdditions.m
  152. +16 −0 Kiwi/NSValue+KiwiAdditions.h
  153. +24 −0 Kiwi/NSValue+KiwiAdditions.m
  154. +27 −0 License.txt
  155. +13 −0 Other Sources/Kiwi_Prefix.pch
  156. +14 −0 Other Sources/main.m
  157. +15 −0 Readme.txt
  158. BIN Resources/Icon.png
  159. +30 −0 Resources/KiwiDriver-Info.plist
  160. +20 −0 Resources/KiwiTests-Info.plist
  161. +156 −0 Resources/KiwiViewController.xib
  162. +227 −0 Resources/MainWindow.xib
  163. +43 −0 Tests/KWBeBetweenMatcherTest.m
  164. +43 −0 Tests/KWBeEmptyMatcherTest.m
  165. +44 −0 Tests/KWBeIndenticalToMatcherTest.m
  166. +43 −0 Tests/KWBeKindOfClassMatcherTest.m
  167. +43 −0 Tests/KWBeMemberOfClassMatcherTest.m
  168. +64 −0 Tests/KWBeTrueMatcherTest.m
  169. +43 −0 Tests/KWBeWithinMatcherTest.m
  170. +48 −0 Tests/KWBlockRaiseMatcherTest.m
  171. +43 −0 Tests/KWConformToProtocolMatcherTest.m
  172. +66 −0 Tests/KWContainMatcherTest.m
  173. +37 −0 Tests/KWContextNodeTest.m
  174. +40 −0 Tests/KWDeviceInfoTest.m
  175. +45 −0 Tests/KWEqualMatcherTest.m
  176. +62 −0 Tests/KWExampleGroupBuilderTest.m
  177. +112 −0 Tests/KWHaveMatcherTest.m
  178. +84 −0 Tests/KWInequalityMatcherTest.m
  179. +77 −0 Tests/KWMessagePatternTest.m
  180. +269 −0 Tests/KWMockTest.m
  181. +74 −0 Tests/KWRaiseMatcherTest.m
  182. +61 −0 Tests/KWRealObjectSpyTest.m
  183. +147 −0 Tests/KWRealObjectStubTest.m
  184. +129 −0 Tests/KWReceiveMatcherTest.m
  185. +43 −0 Tests/KWRespondToSelectorMatcherTest.m
  186. +45 −0 Tests/KWStringUtilitiesTest.m
  187. +110 −0 Tests/KWStubTest.m
  188. +42 −0 Tests/KWTestCaseTest.m
  189. +194 −0 Tests/KWValueTest.m
  190. +10 −0 Tests/KiwiTestConfiguration.h
@@ -0,0 +1,10 @@
+*.DS_Store
+
+# Build directory
+build/
+
+# XCode user specific files
+*.mode1v3
+*.mode2v3
+*.perspectivev3
+*.pbxuser
@@ -0,0 +1,11 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "Cruiser.h"
+
+@interface Carrier : Cruiser
+
+@end
@@ -0,0 +1,11 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "Carrier.h"
+
+@implementation Carrier
+
+@end
@@ -0,0 +1,78 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "JumpCapable.h"
+#import "SpaceShip.h"
+
+@class Engine;
+@class Fighter;
+
+@interface Cruiser : SpaceShip<JumpCapable> {
+@private
+ NSString *callsign;
+ Engine *engine;
+ NSArray *fighters;
+}
+
+#pragma mark -
+#pragma mark Initializing
+
+- (id)initWithCallsign:(NSString *)aCallsign;
+
++ (id)cruiser;
++ (id)cruiserWithCallsign:(NSString *)aCallsign;
+
+#pragma mark -
+#pragma mark Properties
+
+@property (nonatomic, readonly) NSString *callsign;
+@property (nonatomic, readonly) Engine *engine;
+
++ (NSString *)classification;
+
+- (NSUInteger)crewComplement;
+
+#pragma mark -
+#pragma mark Managing Fighters
+
+@property (nonatomic, readwrite, retain) NSArray *fighters;
+
+- (Fighter *)fighterWithCallsign:(NSString *)aCallsign;
+- (NSArray *)fightersInSquadron:(NSString *)aSquadron;
+
+#pragma mark -
+#pragma mark Managing Systems
+
+- (BOOL)raiseShields;
+- (float)energyLevelInWarpCore:(NSUInteger)anIndex;
+
+#pragma mark -
+#pragma mark Getting Navigation Information
+
+// starHash => key/2 + key/4 + key/8 + ... 1
+- (NSUInteger)computeStarHashForKey:(NSUInteger)aKey;
+
+#pragma mark -
+#pragma mark Orbiting
+
+- (void)orbitPlanet:(id)aPlanet;
+- (float)orbitPeriodForMass:(float)aMass;
+
+#pragma mark -
+#pragma mark Jumping
+
+- (void)computeParsecs;
+- (void)engageHyperdrive;
+- (NSUInteger)hyperdriveFuelLevel;
+
+#pragma mark -
+#pragma mark Raising
+
+- (void)raise;
+- (void)raiseWithName:(NSString *)aName description:(NSString *)aDescription;
+
+@end
@@ -0,0 +1,136 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "Cruiser.h"
+#import "Engine.h"
+#import "Fighter.h"
+
+@implementation Cruiser
+
+#pragma mark -
+#pragma mark Initializing
+
+- (id)initWithCallsign:(NSString *)aCallsign {
+ if ((self = [super init])) {
+ callsign = [aCallsign copy];
+ }
+
+ return self;
+}
+
++ (id)cruiser {
+ return [self cruiserWithCallsign:nil];
+}
+
++ (id)cruiserWithCallsign:(NSString *)aCallsign {
+ return [[[self alloc] initWithCallsign:aCallsign] autorelease];
+}
+
+- (void)dealloc {
+ [callsign release];
+ [engine release];
+ [fighters release];
+ [super dealloc];
+}
+
+#pragma mark -
+#pragma mark Properties
+
+@synthesize callsign;
+@synthesize engine;
+
++ (NSString *)classification {
+ return @"Capital Ship";
+}
+
+- (NSUInteger)crewComplement {
+ return 1010;
+}
+
+#pragma mark -
+#pragma mark Managing Fighters
+
+@synthesize fighters;
+
+- (Fighter *)fighterWithCallsign:(NSString *)aCallsign {
+ for (Fighter *fighter in self.fighters) {
+ if ([fighter.callsign isEqualToString:aCallsign])
+ return fighter;
+ }
+
+ return nil;
+}
+
+- (NSArray *)fightersInSquadron:(NSString *)aSquadron {
+ NSMutableArray *fightersInSquadron = [[[NSMutableArray alloc] init] autorelease];
+
+ for (Fighter *fighter in self.fighters) {
+ if ([fighter.callsign hasPrefix:aSquadron])
+ [fightersInSquadron addObject:fighter];
+ }
+
+ return fightersInSquadron;
+}
+
+#pragma mark -
+#pragma mark Managing Systems
+
+- (BOOL)raiseShields {
+ return [super raiseShields];
+}
+
+- (float)energyLevelInWarpCore:(NSUInteger)anIndex {
+ return 42.0f * (float)anIndex;
+}
+
+#pragma mark -
+#pragma mark Getting Navigation Information
+
+- (NSUInteger)computeStarHashForKey:(NSUInteger)aKey {
+ if (aKey == 0)
+ return 0;
+
+ return aKey + [self computeStarHashForKey:aKey/2];
+}
+
+#pragma mark -
+#pragma mark Orbiting
+
+- (void)orbitPlanet:(id)aPlanet {
+ NSLog(@"orbiting planet ...");
+}
+
+- (float)orbitPeriodForMass:(float)aMass {
+ return aMass * 9.8f;
+}
+
+#pragma mark -
+#pragma mark Jumping
+
+- (void)computeParsecs {
+ NSLog(@"computing parsecs ...");
+}
+
+- (void)engageHyperdrive {
+ NSLog(@"engaging hyperdrive ...");
+}
+
+- (NSUInteger)hyperdriveFuelLevel {
+ return 77;
+}
+
+#pragma mark -
+#pragma mark Raising
+
+- (void)raise {
+ [NSException raise:@"CruiserException" format:@"-[Cruiser raise]"];
+}
+
+- (void)raiseWithName:(NSString *)aName description:(NSString *)aDescription {
+ [NSException raise:aName format:@"%@", aDescription];
+}
+
+@end
@@ -0,0 +1,11 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface Engine : NSObject
+
+@end
@@ -0,0 +1,11 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "Engine.h"
+
+@implementation Engine
+
+@end
@@ -0,0 +1,34 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "SpaceShip.h"
+
+@class Engine;
+
+@interface Fighter : SpaceShip {
+@private
+ NSString *callsign;
+ Engine *engine;
+}
+
+#pragma mark -
+#pragma mark Initializing
+
+- (id)initWithCallsign:(NSString *)aCallsign;
+
++ (id)fighter;
++ (id)fighterWithCallsign:(NSString *)aCallsign;
+
+#pragma mark -
+#pragma mark Properties
+
+@property (nonatomic, readonly) NSString *callsign;
+@property (nonatomic, readonly) Engine *engine;
+
++ (NSString *)classification;
+
+@end
@@ -0,0 +1,46 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "Fighter.h"
+#import "Engine.h"
+
+@implementation Fighter
+
+#pragma mark -
+#pragma mark Initializing
+
+- (id)initWithCallsign:(NSString *)aCallsign {
+ if ((self = [super init])) {
+ callsign = [aCallsign copy];
+ }
+
+ return self;
+}
+
++ (id)fighter {
+ return [self fighterWithCallsign:nil];
+}
+
++ (id)fighterWithCallsign:(NSString *)aCallsign {
+ return [[[self alloc] initWithCallsign:aCallsign] autorelease];
+}
+
+- (void)dealloc {
+ [callsign release];
+ [super dealloc];
+}
+
+#pragma mark -
+#pragma mark Properties
+
+@synthesize callsign;
+@synthesize engine;
+
++ (NSString *)classification {
+ return @"Starfighter";
+}
+
+@end
@@ -0,0 +1,18 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import "OrbitCapable.h"
+
+@protocol JumpCapable<OrbitCapable>
+
+#pragma mark -
+#pragma mark Jumping
+
+- (void)computeParsecs;
+- (void)engageHyperdrive;
+- (NSUInteger)hyperdriveFuelLevel;
+
+@end
@@ -0,0 +1,19 @@
+//
+// Licensed under the terms in License.txt
+//
+// Copyright 2010 Allen Ding. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class KiwiViewController;
+
+@interface KiwiAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ KiwiViewController *viewController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet KiwiViewController *viewController;
+
+@end
Oops, something went wrong.

0 comments on commit 4f0c627

Please sign in to comment.