Permalink
Browse files

Let there be Kiwi BDD

  • Loading branch information...
1 parent 3754f98 commit d7c6fe34b4f777d607914a626f98e807c86574c7 @thestoics thestoics committed Aug 12, 2011
Showing with 16,593 additions and 374 deletions.
  1. +917 −254 Objection.xcodeproj/project.pbxproj
  2. +13 −37 Rakefile
  3. +22 −0 Specs-OSX/Specs-OSX-Info.plist
  4. +7 −0 Specs-OSX/Specs-OSX-Prefix.pch
  5. +2 −0 Specs-OSX/en.lproj/InfoPlist.strings
  6. +22 −0 Specs-iOS/Specs-iOS-Info.plist
  7. +7 −0 Specs-iOS/Specs-iOS-Prefix.pch
  8. +2 −0 Specs-iOS/en.lproj/InfoPlist.strings
  9. +2 −0 Specs/InjectionErrorFixtures.h
  10. +10 −22 Specs/InjectionErrorsSpecs.m
  11. +1 −1 Specs/ModuleFixtures.m
  12. +13 −20 Specs/ModuleUsageSpecs.m
  13. +0 −5 Specs/OSX/main.m
  14. +8 −8 Specs/SpecHelper.h
  15. +0 −15 Specs/SpecHelper.m
  16. +22 −0 Specs/iOSSpecs-Info.plist
  17. +0 −10 Specs/iPhone/main.m
  18. +13 −0 Vendor/Kiwi/.gitignore
  19. +11 −0 Vendor/Kiwi/Classes/Carrier.h
  20. +11 −0 Vendor/Kiwi/Classes/Carrier.m
  21. +77 −0 Vendor/Kiwi/Classes/Cruiser.h
  22. +141 −0 Vendor/Kiwi/Classes/Cruiser.m
  23. +13 −0 Vendor/Kiwi/Classes/Engine.h
  24. +20 −0 Vendor/Kiwi/Classes/Engine.m
  25. +34 −0 Vendor/Kiwi/Classes/Fighter.h
  26. +46 −0 Vendor/Kiwi/Classes/Fighter.m
  27. +18 −0 Vendor/Kiwi/Classes/JumpCapable.h
  28. +19 −0 Vendor/Kiwi/Classes/KiwiAppDelegate.h
  29. +28 −0 Vendor/Kiwi/Classes/KiwiAppDelegate.m
  30. +12 −0 Vendor/Kiwi/Classes/KiwiViewController.h
  31. +61 −0 Vendor/Kiwi/Classes/KiwiViewController.m
  32. +17 −0 Vendor/Kiwi/Classes/OrbitCapable.h
  33. +17 −0 Vendor/Kiwi/Classes/Robot.h
  34. +24 −0 Vendor/Kiwi/Classes/Robot.m
  35. +16 −0 Vendor/Kiwi/Classes/SpaceShip.h
  36. +18 −0 Vendor/Kiwi/Classes/SpaceShip.m
  37. +19 −0 Vendor/Kiwi/Classes/StringPrefixMatcher.h
  38. +46 −0 Vendor/Kiwi/Classes/StringPrefixMatcher.m
  39. +18 −0 Vendor/Kiwi/Classes/TestClasses.h
  40. +41 −0 Vendor/Kiwi/Classes/TestReporter.h
  41. +73 −0 Vendor/Kiwi/Classes/TestReporter.m
  42. +24 −0 Vendor/Kiwi/Classes/TestSpy.h
  43. +27 −0 Vendor/Kiwi/Classes/TestSpy.m
  44. +24 −0 Vendor/Kiwi/Classes/TestVerifier.h
  45. +38 −0 Vendor/Kiwi/Classes/TestVerifier.m
  46. +3 −0 Vendor/Kiwi/Contributors.txt
  47. +95 −0 Vendor/Kiwi/Examples/ExampleAsyncSpec.m
  48. +105 −0 Vendor/Kiwi/Examples/ExampleSpec.m
  49. +231 −0 Vendor/Kiwi/Examples/ExampleTestCase.m
  50. +11 −0 Vendor/Kiwi/Examples/OneTestPerSpecExample.m
  51. +38 −0 Vendor/Kiwi/Examples/SimpleSpec.m
  52. +1,651 −0 Vendor/Kiwi/Kiwi.xcodeproj/project.pbxproj
  53. +22 −0 Vendor/Kiwi/Kiwi/KWAfterAllNode.h
  54. +30 −0 Vendor/Kiwi/Kiwi/KWAfterAllNode.m
  55. +22 −0 Vendor/Kiwi/Kiwi/KWAfterEachNode.h
  56. +30 −0 Vendor/Kiwi/Kiwi/KWAfterEachNode.m
  57. +35 −0 Vendor/Kiwi/Kiwi/KWAsyncVerifier.h
  58. +99 −0 Vendor/Kiwi/Kiwi/KWAsyncVerifier.m
  59. +23 −0 Vendor/Kiwi/Kiwi/KWBeBetweenMatcher.h
  60. +79 −0 Vendor/Kiwi/Kiwi/KWBeBetweenMatcher.m
  61. +20 −0 Vendor/Kiwi/Kiwi/KWBeEmptyMatcher.h
  62. +74 −0 Vendor/Kiwi/Kiwi/KWBeEmptyMatcher.m
  63. +20 −0 Vendor/Kiwi/Kiwi/KWBeIdenticalToMatcher.h
  64. +72 −0 Vendor/Kiwi/Kiwi/KWBeIdenticalToMatcher.m
  65. +20 −0 Vendor/Kiwi/Kiwi/KWBeKindOfClassMatcher.h
  66. +55 −0 Vendor/Kiwi/Kiwi/KWBeKindOfClassMatcher.m
  67. +20 −0 Vendor/Kiwi/Kiwi/KWBeMemberOfClassMatcher.h
  68. +55 −0 Vendor/Kiwi/Kiwi/KWBeMemberOfClassMatcher.m
  69. +16 −0 Vendor/Kiwi/Kiwi/KWBeNilMatcher.h
  70. +43 −0 Vendor/Kiwi/Kiwi/KWBeNilMatcher.m
  71. +16 −0 Vendor/Kiwi/Kiwi/KWBeNonNilMatcher.h
  72. +43 −0 Vendor/Kiwi/Kiwi/KWBeNonNilMatcher.m
  73. +23 −0 Vendor/Kiwi/Kiwi/KWBeTrueMatcher.h
  74. +69 −0 Vendor/Kiwi/Kiwi/KWBeTrueMatcher.m
  75. +22 −0 Vendor/Kiwi/Kiwi/KWBeWithinMatcher.h
  76. +109 −0 Vendor/Kiwi/Kiwi/KWBeWithinMatcher.m
  77. +17 −0 Vendor/Kiwi/Kiwi/KWBeZeroMatcher.h
  78. +48 −0 Vendor/Kiwi/Kiwi/KWBeZeroMatcher.m
  79. +22 −0 Vendor/Kiwi/Kiwi/KWBeforeAllNode.h
  80. +30 −0 Vendor/Kiwi/Kiwi/KWBeforeAllNode.m
  81. +22 −0 Vendor/Kiwi/Kiwi/KWBeforeEachNode.h
  82. +30 −0 Vendor/Kiwi/Kiwi/KWBeforeEachNode.m
  83. +37 −0 Vendor/Kiwi/Kiwi/KWBlock.h
  84. +67 −0 Vendor/Kiwi/Kiwi/KWBlock.m
  85. +43 −0 Vendor/Kiwi/Kiwi/KWBlockNode.h
  86. +55 −0 Vendor/Kiwi/Kiwi/KWBlockNode.m
  87. +28 −0 Vendor/Kiwi/Kiwi/KWBlockRaiseMatcher.h
  88. +125 −0 Vendor/Kiwi/Kiwi/KWBlockRaiseMatcher.m
  89. +33 −0 Vendor/Kiwi/Kiwi/KWCallSite.h
  90. +56 −0 Vendor/Kiwi/Kiwi/KWCallSite.m
  91. +20 −0 Vendor/Kiwi/Kiwi/KWConformToProtocolMatcher.h
  92. +55 −0 Vendor/Kiwi/Kiwi/KWConformToProtocolMatcher.m
  93. +31 −0 Vendor/Kiwi/Kiwi/KWContainMatcher.h
  94. +105 −0 Vendor/Kiwi/Kiwi/KWContainMatcher.m
  95. +71 −0 Vendor/Kiwi/Kiwi/KWContextNode.h
  96. +105 −0 Vendor/Kiwi/Kiwi/KWContextNode.m
  97. +15 −0 Vendor/Kiwi/Kiwi/KWCountType.h
  98. +17 −0 Vendor/Kiwi/Kiwi/KWDeviceInfo.h
  99. +33 −0 Vendor/Kiwi/Kiwi/KWDeviceInfo.m
  100. +20 −0 Vendor/Kiwi/Kiwi/KWEqualMatcher.h
  101. +74 −0 Vendor/Kiwi/Kiwi/KWEqualMatcher.m
  102. +37 −0 Vendor/Kiwi/Kiwi/KWExampleGroup.h
  103. +89 −0 Vendor/Kiwi/Kiwi/KWExampleGroup.m
  104. +44 −0 Vendor/Kiwi/Kiwi/KWExampleGroupBuilder.h
  105. +187 −0 Vendor/Kiwi/Kiwi/KWExampleGroupBuilder.m
  106. +22 −0 Vendor/Kiwi/Kiwi/KWExampleNode.h
  107. +36 −0 Vendor/Kiwi/Kiwi/KWExampleNodeVisitor.h
  108. +35 −0 Vendor/Kiwi/Kiwi/KWExistVerifier.h
  109. +70 −0 Vendor/Kiwi/Kiwi/KWExistVerifier.m
  110. +15 −0 Vendor/Kiwi/Kiwi/KWExpectationType.h
  111. +37 −0 Vendor/Kiwi/Kiwi/KWFailure.h
  112. +65 −0 Vendor/Kiwi/Kiwi/KWFailure.m
  113. +16 −0 Vendor/Kiwi/Kiwi/KWFormatter.h
  114. +38 −0 Vendor/Kiwi/Kiwi/KWFormatter.m
  115. +22 −0 Vendor/Kiwi/Kiwi/KWFutureObject.h
  116. +54 −0 Vendor/Kiwi/Kiwi/KWFutureObject.m
  117. +12 −0 Vendor/Kiwi/Kiwi/KWHCMatcher.h
  118. +23 −0 Vendor/Kiwi/Kiwi/KWHamcrestMatcher.h
  119. +57 −0 Vendor/Kiwi/Kiwi/KWHamcrestMatcher.m
  120. +25 −0 Vendor/Kiwi/Kiwi/KWHamrestMatchingAdditions.h
  121. +49 −0 Vendor/Kiwi/Kiwi/KWHamrestMatchingAdditions.m
  122. +54 −0 Vendor/Kiwi/Kiwi/KWHaveMatcher.h
  123. +254 −0 Vendor/Kiwi/Kiwi/KWHaveMatcher.m
  124. +28 −0 Vendor/Kiwi/Kiwi/KWHaveValueMatcher.h
  125. +117 −0 Vendor/Kiwi/Kiwi/KWHaveValueMatcher.m
  126. +33 −0 Vendor/Kiwi/Kiwi/KWInequalityMatcher.h
  127. +117 −0 Vendor/Kiwi/Kiwi/KWInequalityMatcher.m
  128. +47 −0 Vendor/Kiwi/Kiwi/KWIntercept.h
  129. +278 −0 Vendor/Kiwi/Kiwi/KWIntercept.m
  130. +42 −0 Vendor/Kiwi/Kiwi/KWInvocationCapturer.h
  131. +97 −0 Vendor/Kiwi/Kiwi/KWInvocationCapturer.m
  132. +24 −0 Vendor/Kiwi/Kiwi/KWItNode.h
  133. +30 −0 Vendor/Kiwi/Kiwi/KWItNode.m
  134. +45 −0 Vendor/Kiwi/Kiwi/KWMatchVerifier.h
  135. +159 −0 Vendor/Kiwi/Kiwi/KWMatchVerifier.m
  136. +48 −0 Vendor/Kiwi/Kiwi/KWMatcher.h
  137. +91 −0 Vendor/Kiwi/Kiwi/KWMatcher.m
  138. +51 −0 Vendor/Kiwi/Kiwi/KWMatcherFactory.h
  139. +153 −0 Vendor/Kiwi/Kiwi/KWMatcherFactory.m
  140. +35 −0 Vendor/Kiwi/Kiwi/KWMatchers.h
  141. +72 −0 Vendor/Kiwi/Kiwi/KWMatchers.m
  142. +45 −0 Vendor/Kiwi/Kiwi/KWMatching.h
  143. +49 −0 Vendor/Kiwi/Kiwi/KWMessagePattern.h
  144. +226 −0 Vendor/Kiwi/Kiwi/KWMessagePattern.m
  145. +16 −0 Vendor/Kiwi/Kiwi/KWMessageSpying.h
  146. +53 −0 Vendor/Kiwi/Kiwi/KWMessageTracker.h
  147. +151 −0 Vendor/Kiwi/Kiwi/KWMessageTracker.m
  148. +88 −0 Vendor/Kiwi/Kiwi/KWMock.h
  149. +555 −0 Vendor/Kiwi/Kiwi/KWMock.m
  150. +19 −0 Vendor/Kiwi/Kiwi/KWNull.h
  151. +47 −0 Vendor/Kiwi/Kiwi/KWNull.m
  152. +31 −0 Vendor/Kiwi/Kiwi/KWObjCUtilities.h
  153. +97 −0 Vendor/Kiwi/Kiwi/KWObjCUtilities.m
  154. +39 −0 Vendor/Kiwi/Kiwi/KWPendingNode.h
  155. +55 −0 Vendor/Kiwi/Kiwi/KWPendingNode.m
  156. +14 −0 Vendor/Kiwi/Kiwi/KWProbe.h
  157. +21 −0 Vendor/Kiwi/Kiwi/KWProbePoller.h
  158. +72 −0 Vendor/Kiwi/Kiwi/KWProbePoller.m
  159. +25 −0 Vendor/Kiwi/Kiwi/KWRaiseMatcher.h
  160. +121 −0 Vendor/Kiwi/Kiwi/KWRaiseMatcher.m
  161. +63 −0 Vendor/Kiwi/Kiwi/KWReceiveMatcher.h
  162. +320 −0 Vendor/Kiwi/Kiwi/KWReceiveMatcher.m
  163. +39 −0 Vendor/Kiwi/Kiwi/KWRegisterMatchersNode.h
  164. +55 −0 Vendor/Kiwi/Kiwi/KWRegisterMatchersNode.m
  165. +18 −0 Vendor/Kiwi/Kiwi/KWReporting.h
  166. +20 −0 Vendor/Kiwi/Kiwi/KWRespondToSelectorMatcher.h
  167. +55 −0 Vendor/Kiwi/Kiwi/KWRespondToSelectorMatcher.m
  168. +50 −0 Vendor/Kiwi/Kiwi/KWSpec.h
  169. +328 −0 Vendor/Kiwi/Kiwi/KWSpec.m
  170. +20 −0 Vendor/Kiwi/Kiwi/KWStringUtilities.h
  171. +90 −0 Vendor/Kiwi/Kiwi/KWStringUtilities.m
  172. +37 −0 Vendor/Kiwi/Kiwi/KWStub.h
  173. +135 −0 Vendor/Kiwi/Kiwi/KWStub.m
  174. +45 −0 Vendor/Kiwi/Kiwi/KWTestCase.h
  175. +192 −0 Vendor/Kiwi/Kiwi/KWTestCase.m
  176. +59 −0 Vendor/Kiwi/Kiwi/KWUserDefinedMatcher.h
  177. +166 −0 Vendor/Kiwi/Kiwi/KWUserDefinedMatcher.m
  178. +97 −0 Vendor/Kiwi/Kiwi/KWValue.h
  179. +359 −0 Vendor/Kiwi/Kiwi/KWValue.m
  180. +21 −0 Vendor/Kiwi/Kiwi/KWVerifying.h
  181. +18 −0 Vendor/Kiwi/Kiwi/KWWorkarounds.h
  182. +26 −0 Vendor/Kiwi/Kiwi/KWWorkarounds.m
  183. +94 −0 Vendor/Kiwi/Kiwi/Kiwi.h
  184. +33 −0 Vendor/Kiwi/Kiwi/KiwiBlockMacros.h
  185. +30 −0 Vendor/Kiwi/Kiwi/KiwiConfiguration.h
  186. +62 −0 Vendor/Kiwi/Kiwi/KiwiMacros.h
  187. +10 −0 Vendor/Kiwi/Kiwi/KiwiNewMacros.h
  188. +28 −0 Vendor/Kiwi/Kiwi/NSInvocation+KiwiAdditions.h
  189. +93 −0 Vendor/Kiwi/Kiwi/NSInvocation+KiwiAdditions.m
  190. +17 −0 Vendor/Kiwi/Kiwi/NSMethodSignature+KiwiAdditions.h
  191. +22 −0 Vendor/Kiwi/Kiwi/NSMethodSignature+KiwiAdditions.m
  192. +31 −0 Vendor/Kiwi/Kiwi/NSNumber+KiwiAdditions.h
  193. +111 −0 Vendor/Kiwi/Kiwi/NSNumber+KiwiAdditions.m
  194. +20 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiMockAdditions.h
  195. +31 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiMockAdditions.m
  196. +36 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiStubAdditions.h
  197. +108 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiStubAdditions.m
  198. +19 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiVerifierAdditions.h
  199. +26 −0 Vendor/Kiwi/Kiwi/NSObject+KiwiVerifierAdditions.m
  200. +16 −0 Vendor/Kiwi/Kiwi/NSValue+KiwiAdditions.h
  201. +24 −0 Vendor/Kiwi/Kiwi/NSValue+KiwiAdditions.m
  202. +27 −0 Vendor/Kiwi/License.txt
  203. +13 −0 Vendor/Kiwi/Other Sources/Kiwi_Prefix.pch
  204. +14 −0 Vendor/Kiwi/Other Sources/main.m
  205. +61 −0 Vendor/Kiwi/Readme.txt
  206. BIN Vendor/Kiwi/Resources/Icon.png
  207. +30 −0 Vendor/Kiwi/Resources/KiwiDriver-Info.plist
  208. +2 −2 UISpecs-Info.plist → Vendor/Kiwi/Resources/KiwiTests-Info.plist
  209. +156 −0 Vendor/Kiwi/Resources/KiwiViewController.xib
  210. +227 −0 Vendor/Kiwi/Resources/MainWindow.xib
  211. +43 −0 Vendor/Kiwi/Tests/KWBeBetweenMatcherTest.m
  212. +43 −0 Vendor/Kiwi/Tests/KWBeEmptyMatcherTest.m
  213. +44 −0 Vendor/Kiwi/Tests/KWBeIndenticalToMatcherTest.m
  214. +43 −0 Vendor/Kiwi/Tests/KWBeKindOfClassMatcherTest.m
  215. +43 −0 Vendor/Kiwi/Tests/KWBeMemberOfClassMatcherTest.m
  216. +64 −0 Vendor/Kiwi/Tests/KWBeTrueMatcherTest.m
  217. +43 −0 Vendor/Kiwi/Tests/KWBeWithinMatcherTest.m
  218. +48 −0 Vendor/Kiwi/Tests/KWBlockRaiseMatcherTest.m
  219. +43 −0 Vendor/Kiwi/Tests/KWConformToProtocolMatcherTest.m
  220. +82 −0 Vendor/Kiwi/Tests/KWContainMatcherTest.m
  221. +37 −0 Vendor/Kiwi/Tests/KWContextNodeTest.m
  222. +40 −0 Vendor/Kiwi/Tests/KWDeviceInfoTest.m
  223. +63 −0 Vendor/Kiwi/Tests/KWEqualMatcherTest.m
  224. +62 −0 Vendor/Kiwi/Tests/KWExampleGroupBuilderTest.m
  225. +37 −0 Vendor/Kiwi/Tests/KWHamcrestMatcherTest.m
  226. +112 −0 Vendor/Kiwi/Tests/KWHaveMatcherTest.m
  227. +95 −0 Vendor/Kiwi/Tests/KWHaveValueMatcherTest.m
  228. +84 −0 Vendor/Kiwi/Tests/KWInequalityMatcherTest.m
  229. +77 −0 Vendor/Kiwi/Tests/KWMessagePatternTest.m
  230. +269 −0 Vendor/Kiwi/Tests/KWMockTest.m
  231. +74 −0 Vendor/Kiwi/Tests/KWRaiseMatcherTest.m
  232. +61 −0 Vendor/Kiwi/Tests/KWRealObjectSpyTest.m
  233. +147 −0 Vendor/Kiwi/Tests/KWRealObjectStubTest.m
  234. +129 −0 Vendor/Kiwi/Tests/KWReceiveMatcherTest.m
  235. +43 −0 Vendor/Kiwi/Tests/KWRespondToSelectorMatcherTest.m
  236. +45 −0 Vendor/Kiwi/Tests/KWStringUtilitiesTest.m
  237. +110 −0 Vendor/Kiwi/Tests/KWStubTest.m
  238. +42 −0 Vendor/Kiwi/Tests/KWTestCaseTest.m
  239. +116 −0 Vendor/Kiwi/Tests/KWUserDefinedMatcherTest.m
  240. +194 −0 Vendor/Kiwi/Tests/KWValueTest.m
  241. +10 −0 Vendor/Kiwi/Tests/KiwiTestConfiguration.h

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
PROJECT_NAME = "Objection"
CONFIGURATION = "Debug"
-SPECS_TARGET_NAME = "Specs"
-UI_SPECS_TARGET_NAME = "UISpecs"
+SPECS_TARGET_NAME = "Specs-OSX"
+UI_SPECS_TARGET_NAME = "Specs-iOS"
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk"
def xcodebuild_executable
@@ -43,50 +43,26 @@ namespace :artifact do
end
end
-
task :clean do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "clean.output") if (ENV['IS_CI_BOX'])
system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} clean], stdout)
end
-task :build_specs do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_specs.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], stdout)
-end
-
-task :build_uispecs do
- stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_uispecs.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target #{UI_SPECS_TARGET_NAME} -sdk #{SDK_DIR} -configuration #{CONFIGURATION} build], stdout)
-end
-
task :build_all do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_all.output") if (ENV['IS_CI_BOX'])
system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} build], stdout)
end
-desc "OS X Specs"
-task :specs => :build_specs do
- build_dir = build_dir("")
- ENV["DYLD_FRAMEWORK_PATH"] = build_dir
- system_or_exit(File.join(build_dir, SPECS_TARGET_NAME))
-end
-
-require 'tmpdir'
-
-desc "UISpecs"
-task :uispecs => :build_uispecs do
- ENV["DYLD_ROOT_PATH"] = SDK_DIR
- ENV["IPHONE_SIMULATOR_ROOT"] = SDK_DIR
- ENV["CFFIXED_USER_HOME"] = Dir.tmpdir
- ENV["CEDAR_HEADLESS_SPECS"] = "1"
-
- system_or_exit(%Q[#{File.join(build_dir("-iphonesimulator"), "#{UI_SPECS_TARGET_NAME}.app", UI_SPECS_TARGET_NAME)} -RegisterForSystemEvents]);
-end
+namespace :specs do
+ desc "OS X Specs"
+ task :osx do
+ stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_specs.output") if (ENV['IS_CI_BOX'])
+ system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION} build], stdout)
+ end
-desc "Run the Clang static analyzer against the codebase"
-task :clang do
- raise 'No "scan-build" found, you need Clang: http://clang-analyzer.llvm.org' unless
- File.exist?(`which scan-build`.strip)
- sh "#{xcodebuild_executable} -configuration Debug -sdk iphonesimulator4.2 -target Objection-StaticLib clean"
- sh "scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator4.2 -target Objection-StaticLib"
+ desc "iOS Specs"
+ task :ios do
+ stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_uispecs.output") if (ENV['IS_CI_BOX'])
+ system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target #{UI_SPECS_TARGET_NAME} -sdk #{SDK_DIR} -configuration #{CONFIGURATION} build], stdout)
+ end
end
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>atomicobject.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'Specs-OSX' target in the 'Specs-OSX' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>atomicobject.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'Specs-iOS' target in the 'Specs-iOS' project
+//
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+#endif
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
@@ -1,3 +1,5 @@
+#import <Foundation/Foundation.h>
+
@interface UnsupportedPropertyObject : NSObject {
NSInteger myInteger;
}
@@ -10,40 +10,28 @@
});
it(@"throws an exception if property type is not an object", ^{
- @try {
- [[JSObjection globalInjector] getObject:[UnsupportedPropertyObject class]];
- fail(@"Should have thrown an exception");
- }
- @catch (NSException * e) {
- assertThat([e reason], is(@"Unable to determine class type for property declaration: 'myInteger'"));
- }
+ [[theBlock(^{
+ [[JSObjection globalInjector] getObject:[UnsupportedPropertyObject class]];
+ }) should] raiseWithReason:@"Unable to determine class type for property declaration: 'myInteger'"];
});
it(@"throws an exception if property cannot be found", ^{
- @try {
+ [[theBlock(^{
[[JSObjection globalInjector] getObject:[BadPropertyObject class]];
- fail(@"Should have thrown an exception");
- }
- @catch (NSException * e) {
- assertThat([e reason], is(@"Unable to find property declaration: 'badProperty'"));
- }
-
+ }) should] raiseWithReason:@"Unable to find property declaration: 'badProperty'"];
});
it(@"throws if an object requires a protocol that does not exist in the context", ^{
- assertRaises(^{
+ [[theBlock(^{
[[JSObjection globalInjector] getObject:[ManualCar class]];
- }, @"Cannot find an instance that is bound to the protocol 'GearBox' to assign to the property 'gearBox'");
+ }) should] raiseWithReason:@"Cannot find an instance that is bound to the protocol 'GearBox' to assign to the property 'gearBox'"];
+
});
it(@"throws if instantiation rule is not valid", ^{
- @try {
+ [[theBlock(^{
[JSObjection registerClass:[CarFactory class] lifeCycle:3];
- fail(@"Should have thrown an exception");
- }
- @catch (NSException * e) {
- assertThat([e reason], is(@"Invalid Instantiation Rule"));
- }
+ }) should] raiseWithReason:@"Invalid Instantiation Rule"];
});
View
@@ -36,7 +36,7 @@ @implementation MyModule
@synthesize instrumentInvalidMetaClass = _instrumentInvalidMetaClass;
- (id)initWithEngine:(Engine *)engine andGearBox:(id<GearBox>)gearBox {
- if (self = [super init]) {
+ if ((self = [super init])) {
_engine = [engine retain];
_gearBox = [gearBox retain];
}
View
@@ -3,42 +3,39 @@
#import "ModuleFixtures.h"
SPEC_BEGIN(ModuleUsageSpecs)
+ __block MyModule *module = nil;
beforeEach(^{
Engine *engine = [[[Engine alloc] init] autorelease];
id<GearBox> gearBox = [[[AfterMarketGearBox alloc] init] autorelease];
- MyModule *module = [[[MyModule alloc] initWithEngine:engine andGearBox:gearBox] autorelease];
- AddToContext(@"module", module);
+ module = [[[MyModule alloc] initWithEngine:engine andGearBox:gearBox] autorelease];
JSObjectionInjector *injector = [JSObjection createInjector:module];
[JSObjection setGlobalInjector:injector];
});
it(@"merges the modules instance bindings with the injector's context", ^{
- MyModule *module = GetFromContext(@"module");
assertThat([[JSObjection globalInjector] getObject:[Engine class]], is(sameInstance(module.engine)));
});
it(@"uses the module's bounded instance to fill out other objects dependencies", ^{
- MyModule *module = GetFromContext(@"module");
ManualCar *car = [[JSObjection globalInjector] getObject:[ManualCar class]];
assertThat(car.engine, is(sameInstance(module.engine)));
assertThat(car.gearBox, is(sameInstance(module.gearBox)));
});
it(@"supports binding an instance to a protocol", ^{
- MyModule *module = GetFromContext(@"module");
assertThat([[JSObjection globalInjector] getObject:@protocol(GearBox)], is(sameInstance(module.gearBox)));
});
it(@"throws an exception if the instance does not conform to the protocol", ^{
Engine *engine = [[[Engine alloc] init] autorelease];
- assertRaises(^{
+ [[theBlock(^{
MyModule *module = [[[MyModule alloc] initWithEngine:engine andGearBox:(id)@"no go"] autorelease];
- [module configure];
- }, @"Instance does not conform to the GearBox protocol") ;
+ [module configure];
+ }) should] raiseWithReason:@"Instance does not conform to the GearBox protocol"];
});
it(@"supports eager singletons", ^{
@@ -47,19 +44,19 @@
it(@"throws an exception if an attempt is made to register an eager singleton that was not registered as a singleton", ^{
Engine *engine = [[[Engine alloc] init] autorelease];
-
- assertRaises(^{
+
+ [[theBlock(^{
id<GearBox> gearBox = [[[AfterMarketGearBox alloc] init] autorelease];
MyModule *module = [[[MyModule alloc] initWithEngine:engine andGearBox:gearBox] autorelease];
module.instrumentInvalidEagerSingleton = YES;
[JSObjection createInjector:module];
- }, @"Unable to initialize eager singleton for the class 'Car' because it was never registered as a singleton") ;
+ }) should] raiseWithReason:@"Unable to initialize eager singleton for the class 'Car' because it was never registered as a singleton"];
+
});
describe(@"provider bindings", ^{
beforeEach(^{
- MyModule *module = [[[ProviderModule alloc] init] autorelease];
- AddToContext(@"module", module);
+ module = [[[ProviderModule alloc] init] autorelease];
JSObjectionInjector *injector = [JSObjection createInjector:module];
[JSObjection setGlobalInjector:injector];
});
@@ -80,8 +77,7 @@
describe(@"block bindings", ^{
beforeEach(^{
- MyModule *module = [[[BlockModule alloc] init] autorelease];
- AddToContext(@"module", module);
+ module = [[[BlockModule alloc] init] autorelease];
JSObjectionInjector *injector = [JSObjection createInjector:module];
[JSObjection setGlobalInjector:injector];
});
@@ -111,14 +107,11 @@
id<GearBox> gearBox = [[[AfterMarketGearBox alloc] init] autorelease];
Engine *engine = [[[Engine alloc] init] autorelease];
- assertRaises(^{
+ [[theBlock(^{
MyModule *module = [[[MyModule alloc] initWithEngine:engine andGearBox:gearBox] autorelease];
module.instrumentInvalidMetaClass = YES;
[module configure];
- }, @"\"sneaky\" can not be bound to the protocol \"MetaCar\" because it is not a meta class");
+ }) should] raiseWithReason:@"\"sneaky\" can not be bound to the protocol \"MetaCar\" because it is not a meta class"];
});
});
-
-
-
SPEC_END
View
@@ -1,5 +0,0 @@
-#import <Cedar/Cedar.h>
-
-int main (int argc, const char *argv[]) {
- return runAllSpecs();
-}
View
@@ -1,20 +1,20 @@
#define __SPEC_HELPER
#define HC_SHORTHAND
+#define KIWI_DISABLE_MACRO_API
+
#if TARGET_OS_IPHONE
-#import <Cedar-iPhone/SpecHelper.h>
#import <OCHamcrest-iPhone/OCHamcrest.h>
#else
-#import <Cedar/SpecHelper.h>
#import <OCHamcrest/OCHamcrest.h>
#endif
#import "Objection.h"
+#import "Kiwi.h"
+#import <Foundation/Foundation.h>
-#define AddToContext(key, value) [[SpecHelper specHelper].sharedExampleContext setObject:value forKey:key]
-#define GetFromContext(key) [[SpecHelper specHelper].sharedExampleContext objectForKey:key]
-#define SetTarget(value) AddToContext(@"target", value)
-#define GetTarget() GetFromContext(@"target")
-#define NSINT(__i) ([NSNumber numberWithInt:__i])
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+#endif
-void assertRaises(void(^block)(), NSString *expectedReason);
+#define NSINT(__i) ([NSNumber numberWithInt:__i])
View
@@ -1,16 +1 @@
#import "SpecHelper.h"
-
-void assertRaises(void(^block)(), NSString *expectedReason) {
- @try {
- block();
- fail(@"Should have raised an exception");
- }
- @catch (NSException * e) {
- if ([[e name] isEqualToString:@"Spec failure"]) {
- @throw e;
- }
- if (![[e reason] isEqualToString:expectedReason]) {
- fail([NSString stringWithFormat: @"Expected to raise exception with reason: %@ got: %@", expectedReason, [e reason]]);
- }
- }
-}
View
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>atomicobject.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
View
@@ -1,10 +0,0 @@
-#import <UIKit/UIKit.h>
-#import <Cedar-iPhone/Cedar.h>
-
-int main(int argc, char *argv[]) {
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
- int retVal = UIApplicationMain(argc, argv, nil, @"CedarApplicationDelegate");
- [pool release];
- return retVal;
-}
Oops, something went wrong.

0 comments on commit d7c6fe3

Please sign in to comment.